fonts really fixed now?

This commit is contained in:
Titus Tscharntke
2011-07-01 00:03:30 +00:00
parent 7b95fac8cc
commit 97e19785a9
4 changed files with 14 additions and 27 deletions

View File

@@ -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;
//

View File

@@ -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();

View File

@@ -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);