X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=fontpostinst;h=d1766c9aabd3fc802f1ccb75b2790575bbca03bf;hb=3dad400360b6d165ce295d5b4f1d0f2acc7ab50a;hp=6c40ac3bfdc4d97c4352669b8b2931dc64d1107e;hpb=30a68956256aa095d20b5c7e0260550394039e00;p=packages%2Ffontpostinst.git diff --git a/fontpostinst b/fontpostinst index 6c40ac3..d1766c9 100644 --- a/fontpostinst +++ b/fontpostinst @@ -15,8 +15,11 @@ MKFONTSCALE="$MKFONTSCALEBIN" 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 @@ -34,7 +37,8 @@ GNOMEFONTINST="$GNOMEFONTINSTBIN --target $FBASEDIR/fontmap" 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 @@ -50,8 +54,8 @@ umask 022 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) @@ -69,18 +73,18 @@ case "$FTYPE" in ;; 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 @@ -90,15 +94,28 @@ case "$FTYPE" in 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 @@ -111,11 +128,13 @@ cursor.pcf.gz cursor 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