mirror of
https://github.com/glest/glest-source.git
synced 2025-08-15 04:43:58 +02:00
- bugfix for y centering of font for different fonts / languages
This commit is contained in:
@@ -1450,14 +1450,14 @@ Vec2f Renderer::getCentered3DPos(const string &text, Font3D *font, Vec2f &pos, i
|
|||||||
if(lineHeight < h) {
|
if(lineHeight < h) {
|
||||||
//pos.y += ((float)h / 2.f);
|
//pos.y += ((float)h / 2.f);
|
||||||
//pos.y -= ((float(h) / 2.f) - (lineHeight / 2.f));
|
//pos.y -= ((float(h) / 2.f) - (lineHeight / 2.f));
|
||||||
pos.y += (lineHeight / 2.f) + 2;
|
pos.y += (lineHeight / 2.f) + FontMetrics::DEFAULT_Y_OFFSET_FACTOR;
|
||||||
//pos.y -= h;
|
//pos.y -= h;
|
||||||
//printf("Center text [%s] h = %d, lineHeight = %f, pos.y = %f\n",text.c_str(),h,lineHeight,pos.y);
|
//printf("Center text [%s] h = %d, lineHeight = %f, pos.y = %f\n",text.c_str(),h,lineHeight,pos.y);
|
||||||
|
|
||||||
//printf("Center text [%s] h = %d, lineHeight = %f, pos.y = %f\n",text.c_str(),h,lineHeight,pos.y);
|
//printf("Center text [%s] h = %d, lineHeight = %f, pos.y = %f\n",text.c_str(),h,lineHeight,pos.y);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pos.y += ((float)h / 2.f) - 2;
|
pos.y += ((float)h / 2.f) - FontMetrics::DEFAULT_Y_OFFSET_FACTOR;
|
||||||
}
|
}
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
@@ -66,6 +66,7 @@ public:
|
|||||||
static bool forceLegacyFonts;
|
static bool forceLegacyFonts;
|
||||||
static bool fontIsRightToLeft;
|
static bool fontIsRightToLeft;
|
||||||
static float scaleFontValue;
|
static float scaleFontValue;
|
||||||
|
//static int scaleFontYOffset;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum Width {
|
enum Width {
|
||||||
|
@@ -36,9 +36,10 @@ int Font::charCount = 256;
|
|||||||
std::string Font::fontTypeName = "Times New Roman";
|
std::string Font::fontTypeName = "Times New Roman";
|
||||||
bool Font::fontIsMultibyte = false;
|
bool Font::fontIsMultibyte = false;
|
||||||
bool Font::forceLegacyFonts = false;
|
bool Font::forceLegacyFonts = false;
|
||||||
float FontMetrics::DEFAULT_Y_OFFSET_FACTOR = 8.0f;
|
float FontMetrics::DEFAULT_Y_OFFSET_FACTOR = 0.0f;
|
||||||
bool Font::fontIsRightToLeft = false;
|
bool Font::fontIsRightToLeft = false;
|
||||||
float Font::scaleFontValue = 0.65;
|
float Font::scaleFontValue = 0.75;
|
||||||
|
//int Font::scaleFontYOffset = 0;
|
||||||
//
|
//
|
||||||
|
|
||||||
// =====================================================
|
// =====================================================
|
||||||
|
Reference in New Issue
Block a user