Skip to content

Commit

Permalink
Force the use of fontconfig fontmap backend on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
loonycyborg authored and Pentarctagon committed Jun 11, 2022
1 parent e0504dc commit 06b0247
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 1 addition & 4 deletions src/font/font_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@

#ifdef CAIRO_HAS_WIN32_FONT
#include <windows.h>
#undef CAIRO_HAS_FT_FONT
#endif

#ifdef CAIRO_HAS_FT_FONT
Expand Down Expand Up @@ -198,9 +197,7 @@ manager::manager()
{
LOG_FT << "Local font configuration loaded\n";
}
#endif

#ifdef CAIRO_HAS_WIN32_FONT
#elif defined(CAIRO_HAS_WIN32_FONT)
for(const std::string& path : filesystem::get_binary_paths("fonts")) {
std::vector<std::string> files;
if(filesystem::is_directory(path)) {
Expand Down
4 changes: 4 additions & 0 deletions src/wesnoth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -997,6 +997,10 @@ int main(int argc, char** argv)
bool log_redirect = true, native_console_implied = false;
// This is optional<bool> instead of tribool because value_or() is exactly the required semantic
std::optional<bool> native_console_force;

_putenv("PANGOCAIRO_BACKEND=fontconfig");
_putenv("FONTCONFIG_PATH=fonts");

// Some switches force a Windows console to be attached to the process even
// if Wesnoth is an IMAGE_SUBSYSTEM_WINDOWS_GUI executable because they
// turn it into a CLI application. Also, --wconsole in particular attaches
Expand Down

0 comments on commit 06b0247

Please sign in to comment.