diff options
Diffstat (limited to 'src/libjin/Graphics/Font.h')
-rw-r--r-- | src/libjin/Graphics/Font.h | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/src/libjin/Graphics/Font.h b/src/libjin/Graphics/Font.h index 7fc96e2..176669c 100644 --- a/src/libjin/Graphics/Font.h +++ b/src/libjin/Graphics/Font.h @@ -19,43 +19,32 @@ namespace graphics class Font: public Drawable { public: - Font(); - /** - * load ttf font data from .ttf - */ - void loadf(const char* file); - - /** - * load ttf font data from memory - */ - void loadb(const unsigned char* data); + void loadFile(const char* file); + void loadMemory(const unsigned char* data); - /** - * render text to screen - */ void render( - const char* str, // rendered text + const char* text, // rendered text float x, float y, // render position - int fheight, // font size + int fondSize, // font size int spacing, // font spacing - int lheight // line height + int lineHeight // line height ); - - void box(const char* str, int fheight, int spacing, int lheight, int* w, int * h); + void box(const char* text, int fontHeight, int spacing, int lineHeight, int* w, int * h); private: - /** - * ASCII 32(space)..126(~) is 95 glyphs + * ASCII 32(space)..126(~) 95 glyphs */ - stbtt_bakedchar cdata[96]; + static const int ASCII_CHARACTER_NUM = 96; + + stbtt_bakedchar asciiData[ASCII_CHARACTER_NUM]; }; -} -} +} // graphics +} // jin #endif // JIN_MODULES_RENDER #endif // __JIN_FONT_H
\ No newline at end of file |