summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-09-02 18:44:03 +0200
committerCarl Hetherington <cth@carlh.net>2023-09-03 20:42:57 +0200
commitdbfb852ea5b7169a80b701089bf0bc7e30c6e328 (patch)
tree45d3a2f035b11fc02353418ce631bb6c960be17e
parent6d5f1a9dd0f3968d44638939aad038ccb20ac9e8 (diff)
Fix rendering of italic fonts during tests on Windows.
-rw-r--r--run/tests.bat1
-rw-r--r--src/lib/util.cc8
2 files changed, 8 insertions, 1 deletions
diff --git a/run/tests.bat b/run/tests.bat
index 598338f17..a9d921788 100644
--- a/run/tests.bat
+++ b/run/tests.bat
@@ -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
diff --git a/src/lib/util.cc b/src/lib/util.cc
index 4240279c6..13a062bc6 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -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