CmFont.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #pragma once
  2. #include "CmPrerequisites.h"
  3. #include "CmResource.h"
  4. #include "CmFontDesc.h"
  5. namespace CamelotEngine
  6. {
  7. // TODO - When saved on disk font currently stores a copy of the texture pages. This should be acceptable
  8. // if you import a new TrueType or OpenType font since the texture will be generated on the spot
  9. // but if you use a bitmap texture to initialize the font manually, then you will potentially have duplicate textures.
  10. // Also, changing the source texture will not automatically update the font because there is no direct link between them.
  11. // -- This is probably not a large problem, but it is something to keep an eye out.
  12. class CM_EXPORT Font : public Resource
  13. {
  14. public:
  15. virtual ~Font();
  16. void initialize(const FONT_DESC& fontDesc, vector<TexturePtr>::type texturePages);
  17. protected:
  18. friend class FontManager;
  19. Font();
  20. private:
  21. vector<TexturePtr>::type mTexturePages;
  22. FONT_DESC mFontDesc;
  23. /************************************************************************/
  24. /* SERIALIZATION */
  25. /************************************************************************/
  26. public:
  27. friend class FontRTTI;
  28. static RTTITypeBase* getRTTIStatic();
  29. virtual RTTITypeBase* getRTTI() const;
  30. /************************************************************************/
  31. /* STATICS */
  32. /************************************************************************/
  33. public:
  34. static FontHandle create(const FONT_DESC& fontDesc, vector<TexturePtr>::type texturePages);
  35. };
  36. }