diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/crepe/facade/Font.cpp (renamed from src/crepe/facade/font.cpp) | 3 | ||||
-rw-r--r-- | src/crepe/facade/Font.h (renamed from src/crepe/facade/font.h) | 18 |
2 files changed, 13 insertions, 8 deletions
diff --git a/src/crepe/facade/font.cpp b/src/crepe/facade/Font.cpp index 259a6cd..2ad176a 100644 --- a/src/crepe/facade/font.cpp +++ b/src/crepe/facade/Font.cpp @@ -19,3 +19,6 @@ Font::Font(const char* src){ Font::Font(std::unique_ptr<Asset> res){ this->load(std::move(res)); } +const TTF_Font& Font::get_font() const{ + return this->font; +} diff --git a/src/crepe/facade/font.h b/src/crepe/facade/Font.h index a8d8040..e34ac63 100644 --- a/src/crepe/facade/font.h +++ b/src/crepe/facade/Font.h @@ -4,6 +4,7 @@ #include <SDL2/SDL_ttf.h> #include "../api/Asset.h" +#include "../api/Config.h" namespace crepe { @@ -14,18 +15,19 @@ namespace crepe { */ class Font : public Resource{ public: - /** - * \param res A unique pointer to an Asset holding the font resource. - */ + /**. + * \param src Asset with texture data to load. + * \param mediator use the SDLContext reference to load the image + */ Font(const Asset & src, Mediator & mediator); - /** - * \brief Destructor to clean up font resources. - */ - ~Font() = default; + + ~Font() = default + const TTF_Font& get_font() const; private: //! The SDL_ttf font object with custom deleter. - std::unique_ptr<TTF_Font, decltype(&TTF_CloseFont)> font; + std::unique_ptr<TTF_Font, decltype(&TTF_CloseFont)> font; + int default_font_size = Config::get_instance().font.font_size; }; } // namespace crepe |