Skip to content

Commit

Permalink
Compatible formatVar for linux so we can use the same syntax everywhere.
Browse files Browse the repository at this point in the history
  • Loading branch information
saurtron committed Dec 11, 2024
1 parent 4cd96ed commit 2e6f6aa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rts/Rendering/Fonts/CFontTexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ class FtLibraryHandler {
std::string configFmtVar = fmt::sprintf(configFmt, osFontsDir.data());
#else
static constexpr const char* configFmt = R"(<fontconfig><cachedir>fontcache</cachedir></fontconfig>)";
std::string configFmtVar = configFmt;
#endif

#ifdef _WIN32
Expand All @@ -169,7 +170,7 @@ class FtLibraryHandler {
if (res) {
#ifndef _WIN32
// add local cache after system config for linux
FcConfigParseAndLoadFromMemory(config, reinterpret_cast<const FcChar8*>(configFmt), FcTrue);
FcConfigParseAndLoadFromMemory(config, reinterpret_cast<const FcChar8*>(configFmtVar.c_str()), FcTrue);
#endif

LOG_MSG("[%s] Using Fontconfig light init", false, __func__);
Expand All @@ -194,7 +195,7 @@ class FtLibraryHandler {
config = fcConfig;

// add our cache at the back of the new config.
FcConfigParseAndLoadFromMemory(config, reinterpret_cast<const FcChar8*>(configFmt), FcTrue);
FcConfigParseAndLoadFromMemory(config, reinterpret_cast<const FcChar8*>(configFmtVar.c_str()), FcTrue);
} else {
LOG_MSG("%s config and fonts. No system fallbacks will be available", false, errprefix.c_str());
}
Expand Down

0 comments on commit 2e6f6aa

Please sign in to comment.