Fix rendering of italic fonts during tests on Windows.
[dcpomatic.git] / src / lib / util.cc
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