diff options
Diffstat (limited to 'src/libjin/Graphics/Font.h')
-rw-r--r-- | src/libjin/Graphics/Font.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/libjin/Graphics/Font.h b/src/libjin/Graphics/Font.h index e4fa12b..0ab482d 100644 --- a/src/libjin/Graphics/Font.h +++ b/src/libjin/Graphics/Font.h @@ -15,9 +15,18 @@ namespace graphics class Font: public Drawable { public: - Font(); + Font * createFont(const char* file); + Font* createFont(const char* data, size_t size); - void loadFile(const char* file); + void box(const char* text, int fontHeight, int spacing, int lineHeight, int* w, int * h); + + private: + /* ASCII 32(space)..126(~) 95 glyphs */ + static const int ASCII_CHARACTER_NUM = 96; + + Font(); + + void loadFile(const char* file); void loadMemory(const unsigned char* data); void render( const char* text, // rendered text @@ -26,14 +35,9 @@ namespace graphics int spacing, // font spacing int lineHeight // line height ); - void box(const char* text, int fontHeight, int spacing, int lineHeight, int* w, int * h); - - private: - /* ASCII 32(space)..126(~) 95 glyphs */ - static const int ASCII_CHARACTER_NUM = 96; stbtt_bakedchar asciiData[ASCII_CHARACTER_NUM]; - + }; } // graphics |