aboutsummaryrefslogtreecommitdiff
path: root/libjin/Graphics/Font.h
diff options
context:
space:
mode:
Diffstat (limited to 'libjin/Graphics/Font.h')
-rw-r--r--libjin/Graphics/Font.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/libjin/Graphics/Font.h b/libjin/Graphics/Font.h
index b71c2cc..4b0a850 100644
--- a/libjin/Graphics/Font.h
+++ b/libjin/Graphics/Font.h
@@ -63,10 +63,14 @@ namespace graphics
static const int DEFAULT_FONT_SIZE = 12;
public:
- static Font* createFont(const FontData* fontData, unsigned int fontSzie = DEFAULT_FONT_SIZE);
+ static Font* createFont(FontData* fontData, unsigned int fontSzie = DEFAULT_FONT_SIZE);
void print(const char* text, int x, int y);
+#if defined(font_debug)
+ void drawAtlas();
+#endif
+
private:
/* font atlas levels */
@@ -77,11 +81,11 @@ namespace graphics
//static const int SPACES_PER_TAB = 4;
static const int TEXTURE_SIZE = 512;
- Font(const FontData* font, unsigned int fontSize);
+ Font(FontData* font, unsigned int fontSize);
~Font();
bool createTexture();
- Glyph* addGlyph(unsigned int character);
+ Glyph* bakeGlyph(unsigned int character);
Glyph* findGlyph(unsigned int character);
//float getCharWidth(int c, int last);
@@ -89,7 +93,7 @@ namespace graphics
std::vector<GLuint> textures;
std::map<unsigned int, Glyph*> glyphs; // map glyph codepoint to Glyph
- const FontData* font;
+ FontData* font;
const unsigned int fontsize;
unsigned int baseline;