Added Arch Linux's path for the Deja Vu Seriff font to the list of default fonts.

This commit is contained in:
Aloshi 2012-11-19 19:57:34 -06:00
parent 989ba9a8f9
commit 807c4b2f5b
2 changed files with 17 additions and 1 deletions

View file

@ -1,3 +1,6 @@
November 19
-Added Arch Linux's DejaVuSeriff.ttf path to the list of fonts to check for.
November 17 November 17
-Fixed default game image resizing if none is defined. -Fixed default game image resizing if none is defined.
-Heavily refactored theming. You shouldn't notice any changes, but if something broke, let me know! -Heavily refactored theming. You shouldn't notice any changes, but if something broke, let me know!

View file

@ -3,6 +3,7 @@
#include <algorithm> #include <algorithm>
#include <vector> #include <vector>
#include "Renderer.h" #include "Renderer.h"
#include <boost/filesystem.hpp>
FT_Library Font::sLibrary; FT_Library Font::sLibrary;
bool Font::libraryInitialized = false; bool Font::libraryInitialized = false;
@ -14,7 +15,19 @@ int Font::getSize() { return mSize; }
std::string Font::getDefaultPath() std::string Font::getDefaultPath()
{ {
return "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf"; int fontCount = 2;
std::string fonts[] = {"/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf",
"/usr/share/fonts/TTF/DejaVuSerif.ttf" };
for(int i = 0; i < fontCount; i++)
{
if(boost::filesystem::exists(fonts[i]))
return fonts[i];
}
std::cerr << "Error - could not find a font!\n";
return "";
} }
void Font::initLibrary() void Font::initLibrary()