Commit 55eb1ef8 authored by Akira TAGOH's avatar Akira TAGOH
Browse files

Add an user font directory for Win32 to the default font path

Patch from @takase1121

Fixes #144
parent 9a6ad6f1
Pipeline #485561 passed with stage
in 12 minutes and 25 seconds
......@@ -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'
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment