#!/bin/sh set +e if [ "$1" = triggered ]; then # Force regeneration of all fontconfig cache files. mkdir -p /var/cache/fontconfig fc-cache -s -v 1>/var/log/fontconfig.log 2>&1 || printf "fc-cache failed.\nSee /var/log/fontconfig.log for more information.\n" exit 0 fi if [ "$1" = configure ]; then # If defoma is installed, ensure Defoma subst file exists, with some default substitutions if [ -x "`which defoma-subst`" ]; then if ! defoma-subst check-rule fontconfig; then defoma-subst new-rule fontconfig \ 'serif --GeneralFamily,* Roman --Shape Serif Upright --Weight Medium' \ 'sans-serif --GeneralFamily,* SansSerif --Shape NoSerif Upright --Weight Medium' \ 'monospace --Width,* Fixed --GeneralFamily,2 Typewriter --Shape Upright --Weight Medium' fi fi fi #DEBHELPER# if [ "$1" = configure ]; then if dpkg --compare-versions "$2" lt 2.4.0-1; then printf "Cleaning up old fontconfig caches... " for dir in /usr/share/fonts /var/lib/defoma/fontconfig.d /usr/X11R6/lib/X11/fonts /usr/local/share/fonts ; do if [ -d $dir ]; then find $dir -name fonts.cache-1 -exec rm -f \{\} \; find $dir -depth -mindepth 1 -type d -exec rmdir --ignore-fail-on-non-empty \{\} \; fi done printf "done.\n" fi # Force regeneration of all fontconfig cache files. mkdir -p /var/cache/fontconfig printf "Regenerating fonts cache... " fc-cache -s -f -v 1>/var/log/fontconfig.log 2>&1 || (printf "failed.\nSee /var/log/fontconfig.log for more information.\n"; exit 1) printf "done.\n" fi