BsFontImportOptions.h 2.0 KB

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