aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/facade/Font.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/facade/Font.cpp')
-rw-r--r--src/crepe/facade/Font.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/crepe/facade/Font.cpp b/src/crepe/facade/Font.cpp
index f202c05..81a9e7a 100644
--- a/src/crepe/facade/Font.cpp
+++ b/src/crepe/facade/Font.cpp
@@ -2,6 +2,7 @@
#include "../api/Asset.h"
#include "../api/Config.h"
+#include <string>
#include "Font.h"
@@ -11,6 +12,7 @@ using namespace crepe;
Font::Font(const Asset & src, Mediator & mediator) : Resource(src, mediator) {
Config & config = Config::get_instance();
const std::string FONT_PATH = src.get_path();
+
TTF_Font * loaded_font = TTF_OpenFont(FONT_PATH.c_str(), config.font.size);
if (loaded_font == NULL) {
throw runtime_error(format("Font: {} (path: {})", TTF_GetError(), FONT_PATH));
@@ -19,3 +21,4 @@ Font::Font(const Asset & src, Mediator & mediator) : Resource(src, mediator) {
}
TTF_Font * Font::get_font() const { return this->font.get(); }
+