From fb33482a14915373bdfdaeb7d4856cde31d922ab Mon Sep 17 00:00:00 2001 From: WBoerenkamps Date: Thu, 12 Dec 2024 21:28:29 +0100 Subject: added small check to the example --- src/example/loadfont.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/example/loadfont.cpp') diff --git a/src/example/loadfont.cpp b/src/example/loadfont.cpp index efd5a98..3cbe559 100644 --- a/src/example/loadfont.cpp +++ b/src/example/loadfont.cpp @@ -19,6 +19,15 @@ int main() { std::unique_ptr asset = font_facade.get_font_asset(label->font_family); std::cout << "path: " << asset->get_path() << std::endl; std::unique_ptr font = std::make_unique(*asset, mediator); + // Get the TTF_Font from the Font object + TTF_Font* ttf_font = font->get_font(); + + // Check if the font is loaded properly + if (ttf_font != nullptr) { + std::cout << "Font successfully loaded!" << std::endl; + } else { + std::cout << "Failed to load font." << std::endl; + } } catch (const std::exception & e) { std::cout << "Standard exception thrown: " << e.what() << std::endl; } -- cgit v1.2.3