neutrino: GUI Painting of Vol. Mute and Clock (Part1)

- Added getDigitHeight() and getDigitOffset() to fontrenderer (better numerics display)

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2151 e54a6e83-5905-42d5-8d5c-058d10e6a962


Origin commit data
------------------
Branch: ni/coolstream
Commit: 0aeeb601bd
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2012-03-18 (Sun, 18 Mar 2012)

Origin message was:
------------------
* neutrino: GUI Painting of Vol. Mute and Clock (Part1)

- Added getDigitHeight() and getDigitOffset() to fontrenderer (better numerics display)

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2151 e54a6e83-5905-42d5-8d5c-058d10e6a962


------------------
This commit was generated by Migit
This commit is contained in:
Michael Liebmann
2012-03-18 18:46:36 +00:00
parent b1386e14c7
commit 0d935e023b
2 changed files with 15 additions and 1 deletions

View File

@@ -292,6 +292,8 @@ return 0;
upper = halflinegap+ascender+3; // we add 3 at top upper = halflinegap+ascender+3; // we add 3 at top
lower = -descender+halflinegap+1; // we add 1 at bottom lower = -descender+halflinegap+1; // we add 1 at bottom
height=upper+lower; // this is total height == distance of lines height=upper+lower; // this is total height == distance of lines
DigitHeight = ascender+2;
DigitOffset = -descender+halflinegap;
// hack end // 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", //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; 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 UTF8ToUnicode(const char * &text, const bool utf8_encoded) // returns -1 on error
{ {
int unicode_value; int unicode_value;

View File

@@ -51,7 +51,7 @@ class Font
FT_Error getGlyphBitmap(FT_ULong glyph_index, FTC_SBit *sbit); FT_Error getGlyphBitmap(FT_ULong glyph_index, FTC_SBit *sbit);
// these are HACKED values, because the font metrics were unusable. // 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; int fontwidth;
public: public:
@@ -68,6 +68,8 @@ class Font
int getRenderWidth(const char * text, const bool utf8_encoded = false); int getRenderWidth(const char * text, const bool utf8_encoded = false);
int getRenderWidth(const std::string & text, const bool utf8_encoded = false); int getRenderWidth(const std::string & text, const bool utf8_encoded = false);
int getHeight(void); int getHeight(void);
int getDigitHeight(void);
int getDigitOffset(void);
int getWidth(void); int getWidth(void);
int getSize(){return font.width;} int getSize(){return font.width;}
int setSize(int isize); int setSize(int isize);