|
@@ -26,7 +26,7 @@
|
|
|
using namespace Polycode;
|
|
using namespace Polycode;
|
|
|
|
|
|
|
|
FontManager::FontManager() {
|
|
FontManager::FontManager() {
|
|
|
-
|
|
|
|
|
|
|
+ FT_Init_FreeType(&FTLibrary);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
FontManager::~FontManager() {
|
|
FontManager::~FontManager() {
|
|
@@ -35,6 +35,7 @@ FontManager::~FontManager() {
|
|
|
delete entry.font;
|
|
delete entry.font;
|
|
|
}
|
|
}
|
|
|
fonts.clear();
|
|
fonts.clear();
|
|
|
|
|
+ FT_Done_FreeType(FTLibrary);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
unsigned int FontManager::getNumFonts() const {
|
|
unsigned int FontManager::getNumFonts() const {
|
|
@@ -63,7 +64,7 @@ void FontManager::removeFontEntry(FontEntry *entry, bool deleteFont) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void FontManager::registerFont(const String& fontName, const String& fontPath) {
|
|
void FontManager::registerFont(const String& fontName, const String& fontPath) {
|
|
|
- Font *font = new Font(fontPath);
|
|
|
|
|
|
|
+ Font *font = new Font(fontPath, FTLibrary);
|
|
|
if(font->loaded) {
|
|
if(font->loaded) {
|
|
|
FontEntry newEntry;
|
|
FontEntry newEntry;
|
|
|
newEntry.font = font;
|
|
newEntry.font = font;
|