diff options
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | meson.build | 2 | ||||
-rw-r--r-- | src/fcxml.c | 10 |
3 files changed, 12 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index d7505d8..433db7b 100644 --- a/configure.ac +++ b/configure.ac @@ -486,7 +486,7 @@ AC_ARG_WITH(default-fonts, case "$default_fonts" in yes) if test "$os_win32" = "yes"; then - default_fonts="WINDOWSFONTDIR" + default_fonts="WINDOWSFONTDIR,WINDOWSUSERFONTDIR" elif test "$os_darwin" = "yes"; then default_fonts="/System/Library/Fonts,/Library/Fonts,~/Library/Fonts,/System/Library/Assets/com_apple_MobileAsset_Font3,/System/Library/Assets/com_apple_MobileAsset_Font4" else diff --git a/meson.build b/meson.build index 7376784..89be258 100644 --- a/meson.build +++ b/meson.build @@ -208,7 +208,7 @@ prefix = get_option('prefix') fonts_conf = configuration_data() if host_machine.system() == 'windows' - fc_fonts_path = ['WINDOWSFONTDIR'] + fc_fonts_path = ['WINDOWSFONTDIR', 'WINDOWSUSERFONTDIR'] fc_cachedir = 'LOCAL_APPDATA_FONTCONFIG_CACHE' else if host_machine.system() == 'darwin' diff --git a/src/fcxml.c b/src/fcxml.c index 1ee03cf..6b0f613 100644 --- a/src/fcxml.c +++ b/src/fcxml.c @@ -1370,6 +1370,16 @@ _get_real_paths_from_prefix(FcConfigParse *parse, const FcChar8 *path, const FcC if (p) *p = '\0'; strcat ((char *) path, "\\..\\share\\fonts"); } + else if (strcmp ((const char *) path, "WINDOWSUSERFONTDIR") == 0) + { + path = buffer; + if (!(pSHGetFolderPathA && SUCCEEDED(pSHGetFolderPathA(NULL, /* CSIDL_LOCAL_APPDATA */ 28, NULL, 0, (char *) buffer)))) + { + FcConfigMessage(parse, FcSevereError, "SHGetFolderPathA failed"); + return NULL; + } + strcat((char *) path, "\\Microsoft\\Windows\\Fonts"); + } else if (strcmp ((const char *) path, "WINDOWSFONTDIR") == 0) { int rc; |