BsFontImportOptions.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. //__________________________ Banshee Project - A modern game development toolkit _________________________________//
  2. //_____________________________________ www.banshee-project.com __________________________________________________//
  3. //________________________ Copyright (c) 2014 Marko Pintera. All rights reserved. ________________________________//
  4. #pragma once
  5. #include "BsCorePrerequisites.h"
  6. #include "BsImportOptions.h"
  7. #include "BsFont.h"
  8. namespace BansheeEngine
  9. {
  10. /**
  11. * @brief Import options that allow you to control how is a font
  12. * imported.
  13. */
  14. class BS_CORE_EXPORT FontImportOptions : public ImportOptions
  15. {
  16. public:
  17. FontImportOptions();
  18. /**
  19. * @brief Sets font sizes you wish to import. Sizes are in points.
  20. */
  21. void setFontSizes(const Vector<UINT32>& fontSizes) { mFontSizes = fontSizes; }
  22. /**
  23. * @brief Adds an index range of characters to import.
  24. */
  25. void addCharIndexRange(UINT32 from, UINT32 to);
  26. /**
  27. * @brief Clears all character indexes, so no character are imported.
  28. */
  29. void clearCharIndexRanges();
  30. /**
  31. * @brief Sets dots per inch scale to use when rendering the characters into the texture.
  32. */
  33. void setDPI(UINT32 dpi) { mDPI = dpi; }
  34. /**
  35. * @brief Set to true if you want your characters to be antialiased.
  36. */
  37. void setAntialiasing(bool enabled) { mAntialiasing = enabled; }
  38. /**
  39. * @brief Gets the sizes that are to be imported.
  40. */
  41. Vector<UINT32> getFontSizes() const { return mFontSizes; }
  42. /**
  43. * @brief Gets character index ranges to import.
  44. */
  45. Vector<std::pair<UINT32, UINT32>> getCharIndexRanges() const { return mCharIndexRanges; }
  46. /**
  47. * @brief Returns dots per inch scale that will be used when rendering the characters.
  48. */
  49. UINT32 getDPI() const { return mDPI; }
  50. /**
  51. * @brief Query if antialiasing will be used when rendering the characters.
  52. */
  53. bool getAntialiasing() const { return mAntialiasing; }
  54. /************************************************************************/
  55. /* SERIALIZATION */
  56. /************************************************************************/
  57. public:
  58. friend class FontImportOptionsRTTI;
  59. static RTTITypeBase* getRTTIStatic();
  60. virtual RTTITypeBase* getRTTI() const;
  61. private:
  62. Vector<UINT32> mFontSizes;
  63. Vector<std::pair<UINT32, UINT32>> mCharIndexRanges;
  64. UINT32 mDPI;
  65. bool mAntialiasing;
  66. };
  67. }