1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- #ifndef _CCFontFNT_h_
- #define _CCFontFNT_h_
- #include "2d/CCFont.h"
- NS_CC_BEGIN
- class BMFontConfiguration;
- class CC_DLL FontFNT : public Font
- {
-
- public:
-
- static FontFNT * create(const std::string& fntFilePath, const Vec2& imageOffset = Vec2::ZERO);
-
- static void purgeCachedData();
- virtual int* getHorizontalKerningForTextUTF32(const std::u32string& text, int &outNumLetters) const override;
- virtual FontAtlas *createFontAtlas() override;
- void setFontSize(float fontSize);
- int getOriginalFontSize()const;
- static void reloadBMFontResource(const std::string& fntFilePath);
- protected:
-
- FontFNT(BMFontConfiguration *theContfig, const Vec2& imageOffset = Vec2::ZERO);
-
- virtual ~FontFNT();
-
- private:
-
- int getHorizontalKerningForChars(char32_t firstChar, char32_t secondChar) const;
-
- BMFontConfiguration * _configuration;
- Vec2 _imageOffset;
-
- float _fontSize;
- };
- NS_CC_END
- #endif
|