diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-16 20:52:43 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-16 20:52:43 +0100 |
commit | 8abc6008880dd9ed0c16a68a126b49f0eb03caa2 (patch) | |
tree | 98bf7773f81d9896df6c17a7d662dd6f4380023f /src/crepe/facade/Font.cpp | |
parent | 56342ffab9daade7802b015ac83b9c47a8b9b18b (diff) |
fonting
Diffstat (limited to 'src/crepe/facade/Font.cpp')
-rw-r--r-- | src/crepe/facade/Font.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/crepe/facade/Font.cpp b/src/crepe/facade/Font.cpp index 1ee3de1..83e8519 100644 --- a/src/crepe/facade/Font.cpp +++ b/src/crepe/facade/Font.cpp @@ -1,4 +1,5 @@ #include "../api/Config.h" +#include "util/Log.h" #include "Font.h" @@ -6,8 +7,8 @@ using namespace std; using namespace crepe; Font::Font(const Asset & src, Mediator & mediator) - : Resource(src, mediator), - font(nullptr, TTF_CloseFont) { + : Resource(src, mediator) { + dbg_trace(); Config & config = Config::get_instance(); const std::string FONT_PATH = src.get_path(); TTF_Font * font = TTF_OpenFont(FONT_PATH.c_str(), config.font.size); @@ -16,4 +17,9 @@ Font::Font(const Asset & src, Mediator & mediator) this->font = {font, [](TTF_Font * font) { TTF_CloseFont(font); }}; } +Font::~Font(){ + dbg_trace(); + this->font.reset(); +} + TTF_Font * Font::get_font() const { return this->font.get(); } |