- fixed up font alignment and added a way to force ftgl font mode:

--force-ftglfonts
This commit is contained in:
Mark Vejvoda
2011-11-18 19:53:56 +00:00
parent 48da13808f
commit 31fafe4528
6 changed files with 76 additions and 32 deletions

View File

@@ -43,6 +43,7 @@ std::string Font::fontTypeName = "Times New Roman";
bool Font::fontIsMultibyte = false;
bool Font::forceLegacyFonts = false;
bool Font::fontIsRightToLeft = false;
bool Font::forceFTGLFonts = false;
// This value is used to scale the font text rendering
// in 3D render mode
@@ -164,18 +165,23 @@ Font::Font(FontTextHandlerType type) {
if(Font::forceLegacyFonts == false) {
try {
#if defined(USE_FREETYPEGL)
textHandler = NULL;
textHandler = new TextFreetypeGL(type);
if(Font::forceFTGLFonts == false) {
textHandler = NULL;
textHandler = new TextFreetypeGL(type);
}
#else
TextFTGL::faceResolution = Font::faceResolution;
TextFTGL::langHeightText = Font::langHeightText;
textHandler = NULL;
textHandler = new TextFTGL(type);
TextFTGL::faceResolution = Font::faceResolution;
TextFTGL::langHeightText = Font::langHeightText;
else
#endif
{
TextFTGL::faceResolution = Font::faceResolution;
TextFTGL::langHeightText = Font::langHeightText;
textHandler = NULL;
textHandler = new TextFTGL(type);
TextFTGL::faceResolution = Font::faceResolution;
TextFTGL::langHeightText = Font::langHeightText;
}
metrics.setTextHandler(this->textHandler);
}
catch(exception &ex) {