3 # This trigger rebuilds the fonts.dir and fonts.scale files
4 # for packages that install X11 fonts, and update fontconfig's
5 # cache for those fonts.
7 # Arguments: $ACTION = [run/targets]
8 # $TARGET = [post-install/pre-remove]
19 mkfontdir
=usr
/bin
/mkfontdir
20 mkfontscale
=usr
/bin
/mkfontscale
21 fccache
=usr
/bin
/fc-cache
25 echo "post-install pre-remove"
28 if [ ! -x ${mkfontdir} -a ! -x ${mkfontscale} ]; then
32 [ -z "${font_dirs}" ] && exit 0
36 for dir
in ${font_dirs}; do
37 echo "Building ${dir}/fonts.dir..."
38 ${mkfontdir} .
${dir} ||
exit $?
39 echo "Building ${dir}/fonts.scale..."
40 ${mkfontscale} .
${dir} ||
exit $?
41 echo "Updating fontconfig's cache..."
42 ${fccache} .
${dir} 2>/dev
/null
46 for dir
in ${font_dirs}; do
47 if [ -f .
${dir}/fonts.dir
]; then
48 rm -f .
${dir}/fonts.dir
50 if [ -f .
${dir}/fonts.scale
]; then
51 rm -f .
${dir}/fonts.scale
53 if [ -f .
${dir}/encodings.dir
]; then
54 rm -f .
${dir}/encodings.dir