aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/facade/FontFacade.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/facade/FontFacade.cpp')
-rw-r--r--src/crepe/facade/FontFacade.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/crepe/facade/FontFacade.cpp b/src/crepe/facade/FontFacade.cpp
index 7edfeb8..cec3507 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"
@@ -16,7 +17,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.");
}
@@ -32,8 +33,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