diff options
author | chai <chaifix@163.com> | 2018-09-02 10:08:58 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-09-02 10:08:58 +0800 |
commit | 3bb587f0d7c471a70683fa7d26939d21968dea98 (patch) | |
tree | 6ef9e75b5159dda0a8d1dc4ef8640be4eacc6343 /src/libjin/Graphics/Font.h | |
parent | 862763a88f6b4a6cb6c034287c509a91776adf8b (diff) |
*update
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 |