From a456169068e7a1ca8715860715fbe912d6cf7fa5 Mon Sep 17 00:00:00 2001 From: Patrick Storz Date: Tue, 26 Feb 2019 23:14:29 +0100 Subject: CMake/MSYS2: Include per-user font directory in fontconfig As of Windows 10 (version 1809) fonts are installed per-user by default into the folder %localappdata%\Microsoft\Windows\Fonts which is not picked up (yet) by fontconfig. Add this folder manually as a font directory to fonts.conf Fixed issues: - https://gitlab.com/inkscape/inkscape/issues/50 --- CMakeScripts/InstallMSYS2.cmake | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'CMakeScripts') diff --git a/CMakeScripts/InstallMSYS2.cmake b/CMakeScripts/InstallMSYS2.cmake index 07d535110..e1af1db70 100644 --- a/CMakeScripts/InstallMSYS2.cmake +++ b/CMakeScripts/InstallMSYS2.cmake @@ -168,12 +168,18 @@ if(WIN32) PATTERN "fonts.conf" EXCLUDE) install(FILES ${MINGW_PATH}/share/fontconfig/conf.avail/70-no-bitmaps.conf DESTINATION etc/fonts/conf.d) - # adjust fonts.conf to store font cache in AppData - set(cachedir_default "\\t^/var/cache/fontconfig^") # the '^' are needed to escape angle brackets on Windows command shell - set(cachedir_appdata "\\t^LOCAL_APPDATA_FONTCONFIG_CACHE^") + # adjust fonts.conf + # - add "%localappdata%\Microsoft\Windows\Fonts" as font dir + # which is the default path for fonts installed per-user in Windows 10 (version 1809) + # - store font cache in non-temporary directory in "%localappdata%\fontconfig\cache" + set(fontdir_default "\\t^WINDOWSFONTDIR^") # the '^' are needed to escape angle brackets on Windows command shell + set(fontdir_additional "\\t^~/AppData/Local/Microsoft/Windows/Fonts^") + set(cachedir_default "\\t^/var/cache/fontconfig^") + set(cachedir_appdata "\\t^LOCAL_APPDATA_FONTCONFIG_CACHE^") add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/etc/fonts/fonts.conf - COMMAND sed 's!${cachedir_default}!${cachedir_appdata}\\n${cachedir_default}!' ${MINGW_PATH}/etc/fonts/fonts.conf > ${CMAKE_BINARY_DIR}/etc/fonts/fonts.conf + COMMAND sed 's!${fontdir_default}!${fontdir_default}\\n${fontdir_additional}!' ${MINGW_PATH}/etc/fonts/fonts.conf | + sed 's!${cachedir_default}!${cachedir_appdata}\\n${cachedir_default}!' > ${CMAKE_BINARY_DIR}/etc/fonts/fonts.conf MAIN_DEPENDENCY ${MINGW_PATH}/etc/fonts/fonts.conf ) add_custom_target(fonts_conf ALL DEPENDS ${CMAKE_BINARY_DIR}/etc/fonts/fonts.conf) -- cgit v1.2.3