summaryrefslogtreecommitdiffstats
path: root/CMakeScripts/InstallMSYS2.cmake
diff options
context:
space:
mode:
authorPatrick Storz <eduard.braun2@gmx.de>2019-02-26 22:14:29 +0000
committerPatrick Storz <eduard.braun2@gmx.de>2019-02-26 22:14:29 +0000
commita456169068e7a1ca8715860715fbe912d6cf7fa5 (patch)
treee55b7e9ae69e879a4ba77d600acafff0b6a8fe97 /CMakeScripts/InstallMSYS2.cmake
parentIncrease portability of create_default_templates.py (diff)
downloadinkscape-a456169068e7a1ca8715860715fbe912d6cf7fa5.tar.gz
inkscape-a456169068e7a1ca8715860715fbe912d6cf7fa5.zip
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
Diffstat (limited to '')
-rw-r--r--CMakeScripts/InstallMSYS2.cmake14
1 files changed, 10 insertions, 4 deletions
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^<cachedir^>/var/cache/fontconfig^</cachedir^>") # the '^' are needed to escape angle brackets on Windows command shell
- set(cachedir_appdata "\\t^<cachedir^>LOCAL_APPDATA_FONTCONFIG_CACHE^</cachedir^>")
+ # 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^<dir^>WINDOWSFONTDIR^</dir^>") # the '^' are needed to escape angle brackets on Windows command shell
+ set(fontdir_additional "\\t^<dir^>~/AppData/Local/Microsoft/Windows/Fonts^</dir^>")
+ set(cachedir_default "\\t^<cachedir^>/var/cache/fontconfig^</cachedir^>")
+ set(cachedir_appdata "\\t^<cachedir^>LOCAL_APPDATA_FONTCONFIG_CACHE^</cachedir^>")
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)