diff options
Diffstat (limited to 'src/crepe/facade/Font.cpp')
-rw-r--r-- | src/crepe/facade/Font.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/crepe/facade/Font.cpp b/src/crepe/facade/Font.cpp index 37dee3a..85b0e13 100644 --- a/src/crepe/facade/Font.cpp +++ b/src/crepe/facade/Font.cpp @@ -5,21 +5,21 @@ using namespace std; using namespace crepe; -Font::Font(const Asset& src, Mediator& mediator) - : Resource(src, mediator), font(nullptr, TTF_CloseFont) { - // Get the font file path from the Asset - const std::string font_path = src.get_path(); +Font::Font(const Asset & src, Mediator & mediator) + : Resource(src, mediator), + font(nullptr, TTF_CloseFont) { + // Get the font file path from the Asset + const std::string font_path = src.get_path(); - // Attempt to load the font - this->font.reset(TTF_OpenFont(font_path.c_str(), Config::get_instance().font.size)); + // Attempt to load the font + this->font.reset(TTF_OpenFont(font_path.c_str(), Config::get_instance().font.size)); - // Check if font loading failed - if (!this->font) { - throw runtime_error(format("Failed to load font from path: {}" - ". SDL_ttf error: {}",font_path, TTF_GetError())); - } + // Check if font loading failed + if (!this->font) { + throw runtime_error(format("Failed to load font from path: {}" + ". SDL_ttf error: {}", + font_path, TTF_GetError())); + } } -TTF_Font* Font::get_font() const { - return this->font.get(); -} +TTF_Font * Font::get_font() const { return this->font.get(); } |