Add an user font directory for Win32 to the default font path
Patch from @takase1121 Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/144
This commit is contained in:
parent
9a6ad6f1c5
commit
55eb1ef89b
|
@ -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
|
||||
|
|
|
@ -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'
|
||||
|
|
10
src/fcxml.c
10
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;
|
||||
|
|
Loading…
Reference in New Issue