small tweak to font height calc

This commit is contained in:
Mark Vejvoda 2011-11-19 02:31:47 +00:00
parent 3ef4692b23
commit cd6b961a3b
2 changed files with 3 additions and 6 deletions

View File

@ -1899,11 +1899,7 @@ Vec2f Renderer::getCentered3DPos(const string &text, Font3D *font, Vec2f &pos, i
else {
pos.y += (float)(((float)h) / 2.0);
float heightGap = (float)(((float)h - lineHeight) / 2.0);
#ifdef USE_STREFLOP
pos.y -= streflop::ceil(heightGap);
#else
pos.y -= ceil(heightGap);
#endif
pos.y -= heightGap;
//printf("h = %d lineHeight = %f heightGap = %f\n",h,lineHeight,heightGap);

View File

@ -224,7 +224,8 @@ float TextFreetypeGL::LineHeight(const char* str, const int len) {
float result = 0;
result = font->height - font->linegap;
//result = font->height - font->linegap;
result = font->ascender - font->descender - font->linegap;
//printf("#2 LineHeight [%s] height = %f linegap = %f ascender = %f descender = %f\n",str,font->height,font->linegap,font->ascender,font->descender);
//result += (result * Font::scaleFontValue);