diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-17 15:33:31 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-17 15:33:31 +0100 |
commit | a8ccf7fe8662086bb223aa4eafd0f85e717d16cf (patch) | |
tree | c114a4b4782a5dcd77e10a326a3e824fcb79d452 /src/crepe/facade/FontFacade.cpp | |
parent | b4335bd670cb7f3f622e6ab701123cfbabd15d37 (diff) |
`make format`
Diffstat (limited to 'src/crepe/facade/FontFacade.cpp')
-rw-r--r-- | src/crepe/facade/FontFacade.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/crepe/facade/FontFacade.cpp b/src/crepe/facade/FontFacade.cpp index d47095f..87f95ab 100644 --- a/src/crepe/facade/FontFacade.cpp +++ b/src/crepe/facade/FontFacade.cpp @@ -10,8 +10,7 @@ using namespace std; using namespace crepe; FontFacade::FontFacade() { - if (!FcInit()) - throw runtime_error("Failed to initialize Fontconfig."); + if (!FcInit()) throw runtime_error("Failed to initialize Fontconfig."); } FontFacade::~FontFacade() { FcFini(); } @@ -22,8 +21,7 @@ Asset FontFacade::get_font_asset(const string & font_family) { if (raw_pattern == NULL) throw runtime_error("Failed to create font pattern."); unique_ptr<FcPattern, function<void(FcPattern *)>> pattern{ - raw_pattern, [](FcPattern * p) { FcPatternDestroy(p); } - }; + raw_pattern, [](FcPattern * p) { FcPatternDestroy(p); }}; FcConfig * config = FcConfigGetCurrent(); if (config == NULL) throw runtime_error("Failed to get current Fontconfig configuration."); @@ -32,9 +30,8 @@ Asset FontFacade::get_font_asset(const string & font_family) { FcPattern * raw_matched_pattern = FcFontMatch(config, pattern.get(), &result); if (raw_matched_pattern == NULL) throw runtime_error("No matching font found."); - unique_ptr<FcPattern, function<void(FcPattern *)>> matched_pattern = { - raw_matched_pattern, [](FcPattern * p) { FcPatternDestroy(p); } - }; + unique_ptr<FcPattern, function<void(FcPattern *)>> matched_pattern + = {raw_matched_pattern, [](FcPattern * p) { FcPatternDestroy(p); }}; FcChar8 * file_path = nullptr; FcResult res = FcPatternGetString(matched_pattern.get(), FC_FILE, 0, &file_path); @@ -44,4 +41,3 @@ Asset FontFacade::get_font_asset(const string & font_family) { string font_file_path = reinterpret_cast<const char *>(file_path); return Asset(font_file_path); } - |