Fix rendering of italic fonts during tests on Windows.
authorCarl Hetherington <cth@carlh.net>
Sat, 2 Sep 2023 16:44:03 +0000 (18:44 +0200)
committerCarl Hetherington <cth@carlh.net>
Sun, 3 Sep 2023 18:42:57 +0000 (20:42 +0200)
run/tests.bat
src/lib/util.cc

index 598338f1782b1deb859ed283f3774b13e32cd03a..a9d9217887ca13d9fef12e46bd70f683b6be5d54 100644 (file)
@@ -4,4 +4,5 @@ xcopy ..\libdcp\tags build\tags\
 copy ..\libdcp\ratings build\
 copy ..\openssl\apps\openssl.exe build\test\
 xcopy fonts build\fonts\
+move build\fonts\fonts.conf.windows build\fonts\fonts.conf
 build\test\unit-tests.exe --log_level=test_suite %1 %2
index 4240279c694d42dd27f03e6a1c6eddcfcbf1a234..13a062bc63e5d8c35bf16efbede63abacb7ea648 100644 (file)
@@ -448,7 +448,13 @@ LIBDCP_ENABLE_WARNINGS
 
 #ifdef DCPOMATIC_WINDOWS
        putenv ("PANGOCAIRO_BACKEND=fontconfig");
-       putenv (String::compose("FONTCONFIG_PATH=%1", resources_path().string()).c_str());
+       if (boost::filesystem::exists(resources_path() / "fonts.conf")) {
+               /* The actual application after installation */
+               putenv(String::compose("FONTCONFIG_PATH=%1", resources_path().string()).c_str());
+       } else {
+               /* The place where fonts.conf is during tests */
+               putenv("FONTCONFIG_PATH=build\\fonts");
+       }
 #endif
 
 #ifdef DCPOMATIC_OSX