mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
remove widest_number definition and usage, add Font::getMaxDigitWidth() method instead
Signed-off-by: M. Liebmann <tuxcode.bbg@gmail.com>
Origin commit data
------------------
Commit: 15b2b2ec05
Author: martii <m4rtii@gmx.de>
Date: 2013-11-29 (Fri, 29 Nov 2013)
This commit is contained in:
@@ -230,6 +230,8 @@ Font::Font(FBFontRenderClass *render, FTC_FaceID faceid, const int isize, const
|
||||
//font.image_type |= ftc_image_flag_autohinted;
|
||||
font.flags = FT_LOAD_RENDER | FT_LOAD_FORCE_AUTOHINT;
|
||||
|
||||
maxdigitwidth = 0;
|
||||
|
||||
scaler.face_id = font.face_id;
|
||||
scaler.width = isize * 64;
|
||||
scaler.height = isize * 64;
|
||||
@@ -318,6 +320,21 @@ int Font::getDigitOffset(void)
|
||||
return DigitOffset;
|
||||
}
|
||||
|
||||
int Font::getMaxDigitWidth(void)
|
||||
{
|
||||
if (maxdigitwidth < 1) {
|
||||
char b[2];
|
||||
b[1] = 0;
|
||||
for (char c = '0'; c <= '9'; c++) {
|
||||
*b = c;
|
||||
int w = getRenderWidth(b, true);
|
||||
if (w > maxdigitwidth)
|
||||
maxdigitwidth = w;
|
||||
}
|
||||
}
|
||||
return maxdigitwidth;
|
||||
}
|
||||
|
||||
int UTF8ToUnicode(const char * &text, const bool utf8_encoded) // returns -1 on error
|
||||
{
|
||||
int unicode_value;
|
||||
|
Reference in New Issue
Block a user