aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-12-12 21:28:29 +0100
committerWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-12-12 21:28:29 +0100
commitfb33482a14915373bdfdaeb7d4856cde31d922ab (patch)
tree0dbaa3d9b6cb11959c501aa0635d70e0d2ee4227 /src
parentcb8af2747fa6999d1a4b97c4785a9cfb37b535c4 (diff)
added small check to the example
Diffstat (limited to 'src')
-rw-r--r--src/example/loadfont.cpp9
1 files changed, 9 insertions, 0 deletions
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> asset = font_facade.get_font_asset(label->font_family);
std::cout << "path: " << asset->get_path() << std::endl;
std::unique_ptr<Font> font = std::make_unique<Font>(*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;
}