add FontManager::load_font()

This commit is contained in:
Josh Holtrop 2014-06-10 21:33:06 -04:00
parent d9261409e0
commit dc47bf5256
2 changed files with 10 additions and 0 deletions

View File

@ -11,4 +11,12 @@ namespace jes
return; return;
} }
} }
FontRef FontManager::load_font(const char * fname, size_t size)
{
FontRef font = new Font();
if (!font->load(m_ft, fname, size))
return NULL;
return font;
}
} }

View File

@ -2,6 +2,7 @@
#define JES_FONTMANAGER_H #define JES_FONTMANAGER_H
#include "jes/Ref.h" #include "jes/Ref.h"
#include "Font.h"
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
@ -11,6 +12,7 @@ namespace jes
{ {
public: public:
FontManager(); FontManager();
FontRef load_font(const char * fname, size_t size);
protected: protected:
FT_Library m_ft; FT_Library m_ft;
}; };