Allow multiple default system font directories in the fallback config, and set them to the default dirs on Darwin.
This commit is contained in:
parent
3fa85f033d
commit
bc84228a2e
45
configure.ac
45
configure.ac
|
@ -89,14 +89,17 @@ PKGCONFIG_REQUIRES=
|
|||
PKGCONFIG_REQUIRES_PRIVATELY=
|
||||
|
||||
dnl ==========================================================================
|
||||
case "$host" in
|
||||
*-*-mingw*)
|
||||
AC_CANONICAL_HOST
|
||||
case "${host_os}" in
|
||||
cygwin*|mingw*)
|
||||
os_win32=yes
|
||||
;;
|
||||
*)
|
||||
os_win32=no
|
||||
darwin*)
|
||||
os_darwin=yes
|
||||
;;
|
||||
esac
|
||||
AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
|
||||
AM_CONDITIONAL(OS_DARWIN, test "$os_darwin" = "yes")
|
||||
|
||||
dnl ==========================================================================
|
||||
dnl gettext stuff
|
||||
|
@ -474,29 +477,41 @@ esac
|
|||
#
|
||||
|
||||
AC_ARG_WITH(default-fonts,
|
||||
[AC_HELP_STRING([--with-default-fonts=DIR],
|
||||
[Use fonts from DIR when config is busted])],
|
||||
[AC_HELP_STRING([--with-default-fonts=DIR1,DIR2,...],
|
||||
[Use fonts from DIR1,DIR2,... when config is busted])],
|
||||
default_fonts="$withval", default_fonts=yes)
|
||||
|
||||
case "$default_fonts" in
|
||||
yes)
|
||||
if test "$os_win32" = "yes"; then
|
||||
FC_DEFAULT_FONTS="WINDOWSFONTDIR"
|
||||
AC_DEFINE_UNQUOTED(FC_DEFAULT_FONTS, "WINDOWSFONTDIR",
|
||||
[Windows font directory])
|
||||
FC_DEFAULT_FONTS_IN="WINDOWSFONTDIR"
|
||||
elif test "$os_darwin" = "yes"; then
|
||||
FC_DEFAULT_FONTS_IN="/System/Library/Fonts,/Library/Fonts,~/Library/Fonts,/System/Library/Assets/com_apple_MobileAsset_Font3,/System/Library/Assets/com_apple_MobileAsset_Font4"
|
||||
else
|
||||
FC_DEFAULT_FONTS="/usr/share/fonts"
|
||||
AC_DEFINE_UNQUOTED(FC_DEFAULT_FONTS, "/usr/share/fonts",
|
||||
[System font directory])
|
||||
FC_DEFAULT_FONTS_IN="/usr/share/fonts"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
FC_DEFAULT_FONTS="$default_fonts"
|
||||
AC_DEFINE_UNQUOTED(FC_DEFAULT_FONTS, "$default_fonts",
|
||||
[System font directory])
|
||||
FC_DEFAULT_FONTS_IN="$default_fonts"
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(FC_DEFAULT_FONTS_IN)
|
||||
|
||||
case "$FC_DEFAULT_FONTS_IN" in
|
||||
"")
|
||||
FC_DEFAULT_FONTS=""
|
||||
;;
|
||||
*)
|
||||
FC_DEFAULT_FONTS=`echo $FC_DEFAULT_FONTS_IN |
|
||||
sed -e 's/^/<dir>/' -e 's/$/<\/dir>/' -e 's/,/<\/dir> <dir>/g'`
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
AC_DEFINE_UNQUOTED(FC_DEFAULT_FONTS, "$FC_DEFAULT_FONTS",
|
||||
[System font directory])
|
||||
|
||||
AC_SUBST(FC_DEFAULT_FONTS)
|
||||
|
||||
#
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
<!-- Font directory list -->
|
||||
|
||||
<dir>@FC_DEFAULT_FONTS@</dir>
|
||||
@FC_DEFAULT_FONTS@
|
||||
@FC_FONTPATH@
|
||||
<dir prefix="xdg">fonts</dir>
|
||||
<!-- the following element will be removed in the future -->
|
||||
|
|
|
@ -207,9 +207,14 @@ if host_machine.system() == 'windows'
|
|||
conf.set_quoted('FC_DEFAULT_FONTS', 'WINDOWSFONTDIR')
|
||||
fonts_conf.set('FC_DEFAULT_FONTS', 'WINDOWSFONTDIR')
|
||||
fc_cachedir = 'LOCAL_APPDATA_FONTCONFIG_CACHE'
|
||||
else
|
||||
if host_machine.system() == 'darwin'
|
||||
conf.set_quoted('FC_DEFAULT_FONTS', '<dir>/System/Library/Fonts</dir> <dir>/Library/Fonts</dir> <dir>~/Library/Fonts</dir> <dir>/System/Library/Assets/com_apple_MobileAsset_Font3</dir> <dir>/System/Library/Assets/com_apple_MobileAsset_Font4</dir>')
|
||||
fonts_conf.set('FC_DEFAULT_FONTS', '<dir>/System/Library/Fonts</dir> <dir>/Library/Fonts</dir> <dir>~/Library/Fonts</dir> <dir>/System/Library/Assets/com_apple_MobileAsset_Font3</dir> <dir>/System/Library/Assets/com_apple_MobileAsset_Font4</dir>')
|
||||
else
|
||||
conf.set_quoted('FC_DEFAULT_FONTS', '/usr/share/fonts')
|
||||
fonts_conf.set('FC_DEFAULT_FONTS', '/usr/share/fonts')
|
||||
endif
|
||||
fc_cachedir = join_paths(prefix, get_option('localstatedir'), 'cache', meson.project_name())
|
||||
thread_dep = dependency('threads')
|
||||
conf.set('HAVE_PTHREAD', 1)
|
||||
|
|
|
@ -41,7 +41,7 @@ FcInitFallbackConfig (const FcChar8 *sysroot)
|
|||
FcConfig *config;
|
||||
const FcChar8 *fallback = (const FcChar8 *) "" \
|
||||
"<fontconfig>" \
|
||||
" <dir>" FC_DEFAULT_FONTS "</dir>" \
|
||||
FC_DEFAULT_FONTS \
|
||||
" <dir prefix=\"xdg\">fonts</dir>" \
|
||||
" <cachedir>" FC_CACHEDIR "</cachedir>" \
|
||||
" <cachedir prefix=\"xdg\">fontconfig</cachedir>" \
|
||||
|
|
Loading…
Reference in New Issue