mirror of
https://github.com/glest/glest-source.git
synced 2025-08-28 10:19:55 +02:00
fonts really fixed now?
This commit is contained in:
@@ -38,7 +38,7 @@ bool Font::fontIsMultibyte = false;
|
||||
bool Font::forceLegacyFonts = false;
|
||||
float FontMetrics::DEFAULT_Y_OFFSET_FACTOR = 2.0f;
|
||||
bool Font::fontIsRightToLeft = false;
|
||||
float Font::scaleFontValue = 0.75;
|
||||
float Font::scaleFontValue = 1.0;
|
||||
int Font::baseSize = 0;
|
||||
//int Font::scaleFontYOffset = 0;
|
||||
//
|
||||
|
@@ -225,13 +225,17 @@ float TextFTGL::LineHeight(const char* str, const int len) {
|
||||
//FTBBox box = ftFont->BBox(str);
|
||||
//printf("String [%s] lineheight = %f upper_y = %f lower_y = %f\n",str,ftFont->LineHeight(),box.Upper().Y(),box.Lower().Y());
|
||||
|
||||
//return ftFont->Ascender() + ftFont->Descender();
|
||||
return ftFont->LineHeight();
|
||||
|
||||
//FTBBox box = ftFont->BBox(str);
|
||||
//float result = box.Upper().Y()- box.Lower().Y();
|
||||
//printf("For str [%s] LineHeight = %f, result = %f\n",str, ftFont->LineHeight(),result);
|
||||
//return result;
|
||||
//printf("ftFont->Ascender():%f ftFont->Descender()*-1 = %f ftFont->LineHeight() = %f\n",ftFont->Ascender(),ftFont->Descender()*-1 , ftFont->LineHeight());
|
||||
//return ftFont->Ascender() + ftFont->Descender()*-1 - ftFont->LineHeight();
|
||||
//return ftFont->LineHeight();
|
||||
|
||||
FTBBox box = ftFont->BBox("yW");
|
||||
float result = box.Upper().Y()- box.Lower().Y();
|
||||
//printf("ftFont->BBox(''yW'')%f\n",result);
|
||||
return result;
|
||||
// printf("For str [%s] LineHeight = %f, result = %f\n",str, ftFont->LineHeight(),result);
|
||||
// return result;
|
||||
|
||||
//float urx = box.Upper().X();
|
||||
//float llx = box.Lower().X();
|
||||
|
@@ -592,9 +592,6 @@ void TextRenderer3DGl::internalRender(const string &text, float x, float y, boo
|
||||
{
|
||||
line++;
|
||||
//assertGl();
|
||||
//printf("NEWLINE before [%s]\n",parts[i].c_str());
|
||||
parts[i] = parts[i].erase(0);
|
||||
//printf("NEWLINE after [%s]\n",parts[i].c_str());
|
||||
float yLineValue = (font->getTextHandler()->LineHeight(parts[i].c_str()) * Font::scaleFontValue);
|
||||
//assertGl();
|
||||
translatePos= Vec3f(translatePos.x, translatePos.y - yLineValue, translatePos.z);
|
||||
|
Reference in New Issue
Block a user