Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Akira TAGOH
fontconfig
Commits
55eb1ef8
Commit
55eb1ef8
authored
Jan 17, 2022
by
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
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
configure.ac
View file @
55eb1ef8
...
...
@@ -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
...
...
meson.build
View file @
55eb1ef8
...
...
@@ -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'
...
...
src/fcxml.c
View file @
55eb1ef8
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment