From 2eaebb2a79ef71589a0be89cfe419f874fbadd09 Mon Sep 17 00:00:00 2001 From: WBoerenkamps Date: Thu, 12 Dec 2024 21:21:16 +0100 Subject: removed asset manager --- src/crepe/facade/SDLFontContext.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/crepe/facade/SDLFontContext.cpp') diff --git a/src/crepe/facade/SDLFontContext.cpp b/src/crepe/facade/SDLFontContext.cpp index d7a0bff..e7f04cc 100644 --- a/src/crepe/facade/SDLFontContext.cpp +++ b/src/crepe/facade/SDLFontContext.cpp @@ -8,26 +8,26 @@ using namespace std; SDLFontContext::SDLFontContext(){ if (!FcInit()) { - throw std::runtime_error("Failed to initialize Fontconfig."); + throw runtime_error("Failed to initialize Fontconfig."); } } SDLFontContext::~SDLFontContext(){ FcFini(); } -unique_ptr SDLFontContext::get_font_asset(const std::string & font_family) { +unique_ptr SDLFontContext::get_font_asset(const string & font_family) { // Create a pattern to search for the font family FcPattern* pattern = FcNameParse(reinterpret_cast(font_family.c_str())); if (!pattern) { - throw std::runtime_error("Failed to create font pattern."); + throw runtime_error("Failed to create font pattern."); } // Default configuration FcConfig* config = FcConfigGetCurrent(); if (!config) { FcPatternDestroy(pattern); - throw std::runtime_error("Failed to get current Fontconfig configuration."); + throw runtime_error("Failed to get current Fontconfig configuration."); } // Match the font pattern @@ -36,18 +36,18 @@ unique_ptr SDLFontContext::get_font_asset(const std::string & font_family FcPatternDestroy(pattern); if (!matched_pattern) { - throw std::runtime_error("No matching font found."); + throw runtime_error("No matching font found."); } // Extract the file path FcChar8* file_path = nullptr; if (FcPatternGetString(matched_pattern, FC_FILE, 0, &file_path) != FcResultMatch || !file_path) { FcPatternDestroy(matched_pattern); - throw std::runtime_error("Failed to get font file path."); + throw runtime_error("Failed to get font file path."); } - // Convert the file path to a std::string - std::string font_file_path(reinterpret_cast(file_path)); + // Convert the file path to a string + string font_file_path(reinterpret_cast(file_path)); FcPatternDestroy(matched_pattern); - return std::move(make_unique(font_file_path)); + return move(make_unique(font_file_path)); } -- cgit v1.2.3