MKTTFFONTSCALEBIN="$MKFONTSCALEBIN"
MKTTFFONTSCALE="$MKTTFFONTSCALEBIN"
-#MKTTFFONTSCALEBIN="/usr/bin/ttmkfdir"
-#MKTTFFONTSCALE="$MKFONTSCALEBIN -e /usr/share/fonts/encodings/encodings.dir"
+if [ ! -x "$MKFONTSCALEBIN" -a -f /usr/bin/ttmkfdir ]; then
+ # fallback for X <= 4.2.x
+ MKTTFFONTSCALEBIN="/usr/bin/ttmkfdir"
+ MKTTFFONTSCALE="$MKFONTSCALEBIN -e /usr/share/fonts/encodings/encodings.dir"
+fi
FCCACHEBIN="/usr/X11R6/bin/fc-cache"
if [ ! -x $FCCACHEBIN -a -x /usr/X11R6/bin/xftcache ]; then
if [ -z "$1" ]; then
echo "Usage: fontpostinst TYPE [DIR]"
- echo " TYPE is one of OTF, TTF, Type1, misc, 100dpi, 75dpi, CID, Speedo, PEX"
+ echo " TYPE is one of:"
+ echo " OTF, TTF, Type1, misc, 100dpi, 75dpi, cyrillic, local, CID, Speedo, PEX"
echo " default DIR is $FBASEDIR/TYPE"
exit 1
fi
cd "$FDIR"
if [ "`echo fonts.alias.*`" != 'fonts.alias.*' ]; then
cat fonts.alias.* | LC_ALL=C sort -u > fonts.alias
-else
- rm -f fonts.alias
+elif [ -f fonts.alias ]; then
+ mv -f fonts.alias fonts.alias-save
fi
case "$FTYPE" in
OTF|TTF)
;;
Type1)
rm -f fonts.scale.bak Fontmap.bak
- if "`echo fonts.scale.*`" != 'fonts.scale.*' ]; then
+ if [ "`echo fonts.scale.*`" != 'fonts.scale.*' ]; then
cat fonts.scale.* 2>/dev/null | LC_ALL=C sort -u > fonts.scale.tmp
cat fonts.scale.tmp | wc -l | tr -d ' ' > fonts.scale
cat fonts.scale.tmp >> fonts.scale
rm -f fonts.scale.tmp
- else if [ "`echo *.pf[ab]`" != '*.pf[ab]' ]; then
+ elif [ "`echo *.pf[ab]`" != '*.pf[ab]' ]; then
# no hints - try to generate
if [ -x $MKFONTSCALEBIN ]; then
$MKFONTSCALE
fi
- else
- rm -f fonts.scale
+ elif [ -f fonts.scale ]; then
+ mv -f fonts.scale fonts.scale-save
fi
if [ -x $MKFONTDIRBIN ]; then
$MKFONTDIR
elif [ -x $XFTCACHEBIN ]; then
$XFTCACHE
fi
- if "`echo Fontmap.*`" != 'Fontmap.*' ]; then
+ if [ "`echo Fontmap.*`" != 'Fontmap.*' ]; then
cat Fontmap.* > Fontmap
- else
- rm -f Fontmap
+ elif [ -f Fontmap ]; then
+ mv -f Fontmap Fontmap-save
fi
if [ -x $GNOMEFONTINSTBIN ]; then
$GNOMEFONTINST
fi
;;
+ CID|Speedo)
+ if [ "`echo fonts.scale.*`" != 'fonts.scale.*' ]; then
+ cat fonts.scale.* 2>/dev/null | LC_ALL=C sort -u > fonts.scale.tmp
+ cat fonts.scale.tmp | wc -l | tr -d ' ' > fonts.scale
+ cat fonts.scale.tmp >> fonts.scale
+ rm -f fonts.scale.tmp
+ elif [ -f fonts.scale ]; then
+ mv -f fonts.scale fonts.scale-save
+ fi
+ if [ -x $MKFONTDIRBIN ]; then
+ $MKFONTDIR
+ fi
+ ;;
misc)
# special case - fonts needed for X server to start
if [ -x $MKFONTDIRBIN ]; then
EOF
fi
;;
- 100dpi|75dpi|CID|Speedo|PEX)
+ 100dpi|75dpi|cyrillic|local)
if [ -x $MKFONTDIRBIN ]; then
$MKFONTDIR
fi
;;
+ PEX)
+ ;;
*)
echo "Warning: \"$FTYPE\": unknown font type!" >&2
if [ -x $MKFONTDIRBIN ]; then