diff --git a/src/driver/fontrenderer.cpp b/src/driver/fontrenderer.cpp index 84385943e..662e3968a 100644 --- a/src/driver/fontrenderer.cpp +++ b/src/driver/fontrenderer.cpp @@ -292,6 +292,8 @@ return 0; upper = halflinegap+ascender+3; // we add 3 at top lower = -descender+halflinegap+1; // we add 1 at bottom height=upper+lower; // this is total height == distance of lines + DigitHeight = ascender+2; + DigitOffset = -descender+halflinegap; // hack end //printf("glyph: hM=%d tM=%d hg=%d tg=%d ascender=%d descender=%d height=%d linegap/2=%d upper=%d lower=%d\n", @@ -310,6 +312,16 @@ int Font::getHeight(void) return height; } +int Font::getDigitHeight(void) +{ + return DigitHeight; +} + +int Font::getDigitOffset(void) +{ + return DigitOffset; +} + int UTF8ToUnicode(const char * &text, const bool utf8_encoded) // returns -1 on error { int unicode_value; diff --git a/src/driver/fontrenderer.h b/src/driver/fontrenderer.h index 28d519ea7..e10baf6dc 100644 --- a/src/driver/fontrenderer.h +++ b/src/driver/fontrenderer.h @@ -51,7 +51,7 @@ class Font FT_Error getGlyphBitmap(FT_ULong glyph_index, FTC_SBit *sbit); // these are HACKED values, because the font metrics were unusable. - int height,ascender,descender,upper,lower; + int height,DigitHeight,DigitOffset,ascender,descender,upper,lower; int fontwidth; public: @@ -68,6 +68,8 @@ class Font int getRenderWidth(const char * text, const bool utf8_encoded = false); int getRenderWidth(const std::string & text, const bool utf8_encoded = false); int getHeight(void); + int getDigitHeight(void); + int getDigitOffset(void); int getWidth(void); int getSize(){return font.width;} int setSize(int isize);