diff options
Diffstat (limited to 'src/crepe/facade/FontFacade.cpp')
-rw-r--r-- | src/crepe/facade/FontFacade.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/crepe/facade/FontFacade.cpp b/src/crepe/facade/FontFacade.cpp index 08ff31c..9919032 100644 --- a/src/crepe/facade/FontFacade.cpp +++ b/src/crepe/facade/FontFacade.cpp @@ -1,4 +1,5 @@ #include <fontconfig/fontconfig.h> +#include <iostream> #include <stdexcept> #include "FontFacade.h" @@ -18,7 +19,7 @@ Asset FontFacade::get_font_asset(const string& font_family) { // Create a pattern to search for the font family FcPattern * pattern = FcNameParse(reinterpret_cast<const FcChar8 *>(font_family.c_str())); - if (pattern == NULL) { + if (!pattern) { throw runtime_error("Failed to create font pattern."); } @@ -34,8 +35,7 @@ Asset FontFacade::get_font_asset(const string& font_family) { FcPattern * matched_pattern = FcFontMatch(config, pattern, &result); FcPatternDestroy(pattern); - if (matched_pattern == NULL) { - FcPatternDestroy(matched_pattern); + if (!matched_pattern) { throw runtime_error("No matching font found."); } // Extract the file path |