Fix FC_DEFAULT_FONTS on macOS and with BSD sed

Fix processing of FC_DEFAULT_FONTS when it contains multiple comma-
separated values (i.e. on macOS/Darwin) and fix inserting it into
fonts.conf when using BSD sed.

Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/287
This commit is contained in:
Ryan Schmidt 2021-07-08 15:45:18 -05:00 committed by Akira TAGOH
parent 6e414d61c7
commit 889097353e
2 changed files with 6 additions and 3 deletions

View File

@ -114,7 +114,7 @@ FC_CONFIGDIR = $(subst $(BASECONFIGDIR)/,,$(CONFIGDIR))
fonts.conf: fonts.conf.in Makefile
sed \
-e 's,@FC_CACHEDIR\@,$(FC_CACHEDIR),g' \
-e 's,@FC_DEFAULT_FONTS\@,$(FC_DEFAULT_FONTS),g' \
-e 's,@FC_DEFAULT_FONTS\@, $(FC_DEFAULT_FONTS),g' \
-e 's,@FC_FONTPATH\@,$(FC_FONTPATH),g' \
-e 's,@CONFIGDIR\@,$(FC_CONFIGDIR),g' \
-e 's,@PACKAGE\@,$(PACKAGE),g' \

View File

@ -499,8 +499,11 @@ FC_DEFAULT_FONTS=""
if test x${default_fonts+set} = xset; then
fc_IFS=$IFS
IFS=","
for p in "$default_fonts"; do
FC_DEFAULT_FONTS="$FC_DEFAULT_FONTS\t<dir>$p</dir>\n"
for p in $default_fonts; do
if test x"$FC_DEFAULT_FONTS" != x; then
FC_DEFAULT_FONTS="$FC_DEFAULT_FONTS "
fi
FC_DEFAULT_FONTS="$FC_DEFAULT_FONTS<dir>$p</dir>"
done
IFS=$fc_IFS
fi