I wanted to test out the TTF rendering to see if it would fix mantis 2417 - no luck unfortunately but as a side effect here's a patch to update configure.ac for Linux, as well as let it compile on Ubuntu 10.04, 11.10 & Fedora 16.
Please note - the required versions of freetype & ftgl are just what are installed by default in Ubuntu 10.04, it compiled and ran OK so I'm *assuming* that these versions are OK.
Index: code/graphics/font.cpp
===================================================================
--- code/graphics/font.cpp (revision 8645)
+++ code/graphics/font.cpp (working copy)
@@ -276,7 +276,7 @@ FTGLFont *FontManager::loadFTGLFont(SCP_string fileName, int fontSize, FTGLFontT
if (fontFile == NULL)
{
- mprintf(("Couldn't open font file \"%s\"", fileName));
+ mprintf(("Couldn't open font file \"%s\"", fileName.c_str()));
return NULL;
}
ubyte *fontData = NULL;
@@ -286,13 +286,13 @@ FTGLFont *FontManager::loadFTGLFont(SCP_string fileName, int fontSize, FTGLFontT
if (!fontData)
{
- mprintf(("Couldn't allocate %d bytes for reading font file \"%s\"!", size, fileName));
+ mprintf(("Couldn't allocate %d bytes for reading font file \"%s\"!", size, fileName.c_str()));
return NULL;
}
if (!cfread(fontData, size, 1, fontFile))
{
- mprintf(("Error while reading font data from \"%s\"", fileName));
+ mprintf(("Error while reading font data from \"%s\"", fileName.c_str()));
delete[] fontData;
return NULL;
}
@@ -329,20 +329,20 @@ FTGLFont *FontManager::loadFTGLFont(SCP_string fileName, int fontSize, FTGLFontT
if (fnt == NULL)
{
- mprintf(("Couldn't allocated memory for font object for file \"%s\"", fileName));
+ mprintf(("Couldn't allocated memory for font object for file \"%s\"", fileName.c_str()));
return NULL;
}
if (fnt->Error())
{
- mprintf(("Font loading of font \"%s\" ended with errors! Error code is %d.", fileName, fnt->Error()));
+ mprintf(("Font loading of font \"%s\" ended with errors! Error code is %d.", fileName.c_str(), fnt->Error()));
delete fnt;
return NULL;
}
if (!fnt->FaceSize(fontSize))
{
- mprintf(("Couldn't set face size of font \"%s\" to %d!", fileName, fontSize));
+ mprintf(("Couldn't set face size of font \"%s\" to %d!", fileName.c_str(), fontSize));
delete fnt;
return NULL;
}
@@ -1131,7 +1131,7 @@ void parse_ftgl_font(SCP_string fontFilename)
if (font == NULL)
{
- Warning(LOCATION, "Couldn't load font \"%s\".", fontFilename);
+ Warning(LOCATION, "Couldn't load font \"%s\".", fontFilename.c_str());
return;
}
Index: configure.ac
===================================================================
--- configure.ac (revision 8645)
+++ configure.ac (working copy)
@@ -358,6 +358,16 @@ PKG_CHECK_MODULES([PNG], [libpng >= 1.2.20])
D_CFLAGS=$D_CFLAGS" $PNG_CFLAGS"
FS2_LIBS=$FS2_LIBS" $PNG_LIBS"
+dnl freetype2
+PKG_CHECK_MODULES([FREETYPE2], [freetype2 >= 9.22.3])
+D_CFLAGS=$D_CFLAGS" $FREETYPE2_CFLAGS"
+FS2_LIBS=$FS2_LIBS" $FREETYPE2_LIBS"
+
+dnl ftgl
+PKG_CHECK_MODULES([FTGL], [ftgl >= 2.1.2])
+D_CFLAGS=$D_CFLAGS" $FTGL_CFLAGS"
+FS2_LIBS=$FS2_LIBS" $FTGL_LIBS"
+
dnl LUA
## Checking for lua.pc and if that fails lua5.1.pc
PKG_CHECK_MODULES(
[attachment deleted by a ninja]