mirror of
https://github.com/glest/glest-source.git
synced 2025-02-24 11:42:31 +01:00
- font ycenter fix on windows
This commit is contained in:
parent
852b4aa2d2
commit
ece9755dfd
@ -237,6 +237,9 @@ float TextFTGL::LineHeight(const char* str, const int len) {
|
||||
if(result == -1000) {
|
||||
FTBBox box = ftFont->BBox(TextFTGL::langHeightText.c_str());
|
||||
result = box.Upper().Y()- box.Lower().Y();
|
||||
if(result == 0) {
|
||||
result = ftFont->LineHeight();
|
||||
}
|
||||
//printf("ftFont->BBox(''yW'')%f\n",result);
|
||||
}
|
||||
return result;
|
||||
@ -268,6 +271,19 @@ float TextFTGL::LineHeight(const char* str, const int len) {
|
||||
|
||||
}
|
||||
|
||||
float TextFTGL::LineHeight(const wchar_t* str, const int len) {
|
||||
static float result = -1000;
|
||||
if(result == -1000) {
|
||||
FTBBox box = ftFont->BBox(TextFTGL::langHeightText.c_str());
|
||||
result = box.Upper().Y()- box.Lower().Y();
|
||||
if(result == 0) {
|
||||
result = ftFont->LineHeight();
|
||||
}
|
||||
//printf("ftFont->BBox(''yW'')%f\n",result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void TextFTGL::Render(const wchar_t* str, const int len) {
|
||||
/*
|
||||
FTGL renders the whole string when len == 0
|
||||
@ -282,10 +298,6 @@ float TextFTGL::Advance(const wchar_t* str, const int len) {
|
||||
return ftFont->Advance(str, len);
|
||||
}
|
||||
|
||||
float TextFTGL::LineHeight(const wchar_t* str, const int len) {
|
||||
return ftFont->LineHeight();
|
||||
}
|
||||
|
||||
const char* TextFTGL::findFont(const char *firstFontToTry) {
|
||||
const char* font = NULL;
|
||||
const char* path = NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user