Skip to content

Commit

Permalink
Initialize configFmtVar directly and remove obsolete comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
saurtron committed Dec 11, 2024
1 parent 2e6f6aa commit 23b27ff
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions rts/Rendering/Fonts/CFontTexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,12 @@ class FtLibraryHandler {
// and system fonts included. also linux actually has system config files that can be used by fontconfig.

#ifdef _WIN32
// fontconfig will resolve the special keys here.
std::array<char, 4096> osFontsDir;
ExpandEnvironmentStrings("%WINDIR%\\fonts", osFontsDir.data(), osFontsDir.size()); // expands %HOME% etc.
static constexpr const char* configFmt = R"(<fontconfig><dir>%s</dir><cachedir>fontcache</cachedir></fontconfig>)";
std::string configFmtVar = fmt::sprintf(configFmt, osFontsDir.data());
#else
static constexpr const char* configFmt = R"(<fontconfig><cachedir>fontcache</cachedir></fontconfig>)";
std::string configFmtVar = configFmt;
const std::string configFmtVar = R"(<fontconfig><cachedir>fontcache</cachedir></fontconfig>)";
#endif

#ifdef _WIN32
Expand Down

0 comments on commit 23b27ff

Please sign in to comment.