diff options
author | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-12-14 14:45:10 +0100 |
---|---|---|
committer | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-12-14 14:45:10 +0100 |
commit | fda61be91cd8667fa2b51e3b8a17ba6b93b728c8 (patch) | |
tree | f44ea9104461ef11ca2441e660485e127da2f64a /src/crepe/facade/SDLFontContext.cpp | |
parent | 93f0951738d3ac7b0249b5064c3ee7b6270eeb3a (diff) |
feedback changes
Diffstat (limited to 'src/crepe/facade/SDLFontContext.cpp')
-rw-r--r-- | src/crepe/facade/SDLFontContext.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/crepe/facade/SDLFontContext.cpp b/src/crepe/facade/SDLFontContext.cpp index 5123b3b..e0b9a89 100644 --- a/src/crepe/facade/SDLFontContext.cpp +++ b/src/crepe/facade/SDLFontContext.cpp @@ -17,13 +17,13 @@ Asset SDLFontContext::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) { + if (pattern == NULL) { throw runtime_error("Failed to create font pattern."); } // Default configuration FcConfig * config = FcConfigGetCurrent(); - if (!config) { + if (config == NULL) { FcPatternDestroy(pattern); throw runtime_error("Failed to get current Fontconfig configuration."); } @@ -33,7 +33,7 @@ Asset SDLFontContext::get_font_asset(const string font_family) { FcPattern * matched_pattern = FcFontMatch(config, pattern, &result); FcPatternDestroy(pattern); - if (!matched_pattern) { + if (matched_pattern == NULL) { FcPatternDestroy(matched_pattern); throw runtime_error("No matching font found."); } @@ -41,7 +41,7 @@ Asset SDLFontContext::get_font_asset(const string font_family) { // Extract the file path FcChar8 * file_path = nullptr; if (FcPatternGetString(matched_pattern, FC_FILE, 0, &file_path) != FcResultMatch - || !file_path) { + || file_path == NULL) { FcPatternDestroy(matched_pattern); throw runtime_error("Failed to get font file path."); } |