Index: build/premake/extern_libs5.lua =================================================================== --- build/premake/extern_libs5.lua +++ build/premake/extern_libs5.lua @@ -308,6 +308,25 @@ end end }, + freetype = { + compile_settings = function() + if os.istarget("windows") then + add_default_include_paths("freetype") + else + pkgconfig.add_includes("freetype2") + end + end, + link_settings = function() + if os.istarget("windows") then + add_default_lib_paths("freetype") + else + pkgconfig.add_links("freetype2") + end + add_default_links({ + win_names = { "freetype" }, + }) + end, + }, gloox = { compile_settings = function() if os.istarget("windows") then Index: build/premake/premake5.lua =================================================================== --- build/premake/premake5.lua +++ build/premake/premake5.lua @@ -756,6 +756,7 @@ "iconv", "libsodium", "fmt", + "freetype", } if not _OPTIONS["without-audio"] then @@ -780,6 +781,7 @@ "spidermonkey", -- for graphics/scripting "boost", "fmt", + "freetype", "icu", } if not _OPTIONS["without-nvtt"] then @@ -963,6 +965,7 @@ "iconv", "libsodium", "fmt", + "freetype", "valgrind", } Index: source/ps/GameSetup/HWDetect.cpp =================================================================== --- source/ps/GameSetup/HWDetect.cpp +++ source/ps/GameSetup/HWDetect.cpp @@ -48,6 +48,10 @@ #include "scriptinterface/Object.h" #include "scriptinterface/ScriptInterface.h" +// FreeType headers might have an include order. +#include +#include + #if OS_LINUX #include #endif @@ -81,9 +85,11 @@ #include #endif +#include #include static void ReportSDL(const ScriptRequest& rq, JS::HandleValue settings); +static void ReportFreeType(const ScriptRequest& rq, JS::HandleValue settings); static void ReportVulkan(const ScriptRequest& rq, JS::HandleValue settings); static void ReportGLLimits(const ScriptRequest& rq, JS::HandleValue settings); @@ -165,6 +171,8 @@ #endif ReportSDL(rq, settings); + ReportFreeType(rq, settings); + ReportVulkan(rq, settings); ReportGLLimits(rq, settings); @@ -226,7 +234,7 @@ Script::SetProperty(rq, settings, "timer_resolution", timer_Resolution()); // The version should be increased for every meaningful change. - const int reportVersion = 16; + const int reportVersion = 17; // Send the same data to the reporting system g_UserReporter.SubmitReport( @@ -256,6 +264,26 @@ // This is null in atlas (and further the call triggers an assertion). const char* backend = g_VideoMode.GetWindow() ? GetSDLSubsystem(g_VideoMode.GetWindow()) : "none"; Script::SetProperty(rq, settings, "sdl_video_backend", backend ? backend : "unknown"); +} + +static void ReportFreeType(const ScriptRequest& rq, JS::HandleValue settings) +{ + FT_Library FTLibrary; + std::string FTSupport = "unsupported"; + if (!FT_Init_FreeType(&FTLibrary)) + { + FT_Int major, minor, patch; + FT_Library_Version(FTLibrary, &major, &minor, &patch); + FT_Done_FreeType(FTLibrary); + std::stringstream version; + version << major << "." << minor << "." << patch; + FTSupport = version.str(); + } + else + { + FTSupport = "cantload"; + } + Script::SetProperty(rq, settings, "freetype", FTSupport); } static void ReportVulkan(const ScriptRequest& rq, JS::HandleValue settings)