From 7450f944defc96d6a47be948af567e97a26655c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rene=CC=81=20de=20Hesselle?= Date: Wed, 1 May 2019 19:04:22 +0200 Subject: Add fontconfig to the application bundle This fixes fonts not showing up and un-breaks the font tool. Add more localizations. --- packaging/macos/020-vars.sh | 1 + packaging/macos/220-inkscape-package.sh | 21 +++++++++ packaging/macos/fonts.conf | 77 +++++++++++++++++++++++++++++++++ packaging/macos/inkscape.bundle | 24 ++++++++-- 4 files changed, 120 insertions(+), 3 deletions(-) create mode 100644 packaging/macos/fonts.conf diff --git a/packaging/macos/020-vars.sh b/packaging/macos/020-vars.sh index 5a3711c0c..6da06ffe9 100644 --- a/packaging/macos/020-vars.sh +++ b/packaging/macos/020-vars.sh @@ -111,6 +111,7 @@ APP_DIR=$ARTIFACT_DIR/Inkscape.app APP_CON_DIR=$APP_DIR/Contents APP_RES_DIR=$APP_CON_DIR/Resources APP_BIN_DIR=$APP_RES_DIR/bin +APP_ETC_DIR=$APP_RES_DIR/etc APP_EXE_DIR=$APP_CON_DIR/MacOS APP_LIB_DIR=$APP_RES_DIR/lib APP_PLIST=$APP_CON_DIR/Info.plist diff --git a/packaging/macos/220-inkscape-package.sh b/packaging/macos/220-inkscape-package.sh index ceff8e04d..08d9477fb 100755 --- a/packaging/macos/220-inkscape-package.sh +++ b/packaging/macos/220-inkscape-package.sh @@ -100,3 +100,24 @@ export PATH=$P36_DIR/bin:$PATH # use Python interpreter from inside the app $P36_DIR/bin/pip3 install lxml $P36_DIR/bin/pip3 install numpy +### fontconfig ################################################################# + +# Mimic the behavior of having all files under 'share' and linking the +# active ones to 'etc'. +cd $APP_ETC_DIR/fonts/conf.d + +for file in ./*.conf; do + ln -sf ../../../share/fontconfig/conf.avail/$(basename $file) +done + +insert_before $APP_EXE_DIR/Inkscape '\$EXEC' \ + 'export FONTCONFIG_PATH=$bundle_res/etc/fonts' + +# Our customized version loses all the non-macOS paths and sets a cache +# directory below '$HOME/Library/Application Support/Inkscape'. +cp $SELF_DIR/fonts.conf $APP_ETC_DIR/fonts + +### GIO modules path ########################################################### + +insert_before $APP_EXE_DIR/Inkscape '\$EXEC' 'export GIO_MODULE_DIR=$bundle_lib/gio/modules' + diff --git a/packaging/macos/fonts.conf b/packaging/macos/fonts.conf new file mode 100644 index 000000000..364bd3bd2 --- /dev/null +++ b/packaging/macos/fonts.conf @@ -0,0 +1,77 @@ + + + + + + + + + Default configuration file + + + + + + /System/Library/Fonts /Library/Fonts ~/Library/Fonts + + + + mono + + + monospace + + + + + + + sans serif + + + sans-serif + + + + + + + sans + + + sans-serif + + + + + conf.d + + + + ~/Library/Application Support/Inkscape/cache/fontconfig + + + + + 30 + + + + + diff --git a/packaging/macos/inkscape.bundle b/packaging/macos/inkscape.bundle index 59d6deecd..ed2cc3512 100644 --- a/packaging/macos/inkscape.bundle +++ b/packaging/macos/inkscape.bundle @@ -80,10 +80,23 @@ ${prefix}/lib/libssl.1.1.dylib + + ${prefix}/lib/gio/modules/*.so + + + + ${prefix}/bin/fc-* + + + ${prefix}/share/locale + + + ${prefix}/share/locale + ${prefix}/share/locale @@ -107,9 +120,14 @@ - ${prefix}/share/themes + ${prefix}/etc/fonts + + + ${prefix}/share/fontconfig + + + ${prefix}/share/glib-2.0 - ${prefix}/share/icons @@ -117,7 +135,7 @@ ${prefix}/share/inkscape - ${prefix}/share/glib-2.0 + ${prefix}/share/themes