--- modules/xttfm.ttfm.orig 2003-11-04 07:08:32.000000000 +0800 +++ modules/xttfm.ttfm 2013-06-18 01:32:45.000000000 +0800 @@ -25,8 +25,8 @@ # Global constants -export PREFIX; PREFIX=/usr/local -export X11BASE; X11BASE=/usr/X11R6 +export PREFIX; PREFIX=%%PREFIX%% +export X11BASE; X11BASE=%%LOCALBASE%% export PATH; PATH=/bin:/sbin:/usr/bin:/usr/sbin:$PREFIX/bin:$PREFIX/sbin:$X11BASE/bin export TEMPFILE; TEMPFILE="`mktemp /tmp/ttfm.tmpXXX`" export DefaultFontPath; DefaultFontPath=$PREFIX/share/fonts/TrueType @@ -86,16 +86,18 @@ for f in "$@"; do targetname=`basename $f` + # Remove font files. + # We only remove those fonts in $DefaultFontPath which are symbolic. + filetype=`file "$DefaultFontPath/$targetname" |grep -e "^$DefaultFontPath/$targetname: symbolic link to"` + [ ! "X$filetype" = "X" ] && rm -f "$DefaultFontPath/$targetname" + rm -f "$XTTFFONTPATH/$targetname" + # Update fonts.scale - rm -f $TEMPFILE - if [ ! -r $XTTFFONTPATH/fonts.scale ]; then - touch $XTTFFONTPATH/fonts.scale - fi - sed -e "/$targetname/d" $XTTFFONTPATH/fonts.scale > $TEMPFILE - i=`cat $TEMPFILE |wc -l` - sed -e "1s/[0-9]*/`expr $i - 1`/" $TEMPFILE > $XTTFFONTPATH/fonts.scale + rm -f $XTTFFONTPATH/fonts.scale + mkfontscale $XTTFFONTPATH # Update fonts.dir, encodings.dir is needed for the sake of xfs. + rm -f $XTTFFONTPATH/fonts.dir if [ -r $XTTFFONTPATH/../encodings/large/encodings.dir ]; then mkfontdir -e $XTTFFONTPATH/../encodings/large $XTTFFONTPATH else @@ -107,12 +109,6 @@ ALIASPATTERN=`eval echo $ALIASPATTERN` sed -e "/$ALIASPATTERN/d" $XTTFFONTPATH/fonts.alias > $TEMPFILE mv -f $TEMPFILE $XTTFFONTPATH/fonts.alias - - # Remove font files. - # We only remove those fonts in $DefaultFontPath which are symbolic. - filetype=`file "$DefaultFontPath/$targetname" |grep -e "^$DefaultFontPath/$targetname: symbolic link to"` - [ ! "X$filetype" = "X" ] && rm -f "$DefaultFontPath/$targetname" - rm -f "$XTTFFONTPATH/$targetname" done } @@ -133,29 +129,11 @@ fontencoding=${10} # Create and update fonts.scale - touch $XTTFFONTPATH/fonts.scale - # Delete the first line, and duplicate entries if exist. - # We can't use uniq(1) here, since filenames may start with numbers. - sed -e "1d" $XTTFFONTPATH/fonts.scale |grep -iv "$fontfoundry-$fontfamily.*-$fontencoding$" > $TEMPFILE - - # Set font parameters - # Speed up font rendering - fontparam="vl=y:" - # Specify the font face index - if [ $facenum -gt 1 ]; then - fontparam="fn=$faceindex:$fontparam" - fi - echo "${fontparam}$targetname -$fontfoundry-$fontfamily-$fontweight-$fontslant-$fontwidth--0-0-0-0-$fontproperties-0-$fontencoding" >> $TEMPFILE - # If it's medium-r, make a {medium,bold}-{i,r} full suite - if [ "X$fontweight" = "Xmedium" ] && [ "X$fontslant" = "Xr" ]; then - echo "${fontparam}ai=0.3:$targetname -$fontfoundry-$fontfamily-medium-i-$fontwidth--0-0-0-0-$fontproperties-0-$fontencoding" >> $TEMPFILE - echo "${fontparam}ds=y:$targetname -$fontfoundry-$fontfamily-bold-r-$fontwidth--0-0-0-0-$fontproperties-0-$fontencoding" >> $TEMPFILE - echo "${fontparam}ds=y:ai=0.3:$targetname -$fontfoundry-$fontfamily-bold-i-$fontwidth--0-0-0-0-$fontproperties-0-$fontencoding" >> $TEMPFILE - fi - echo `cat $TEMPFILE |wc -l` > $XTTFFONTPATH/fonts.scale - cat $TEMPFILE >> $XTTFFONTPATH/fonts.scale + rm -f $XTTFFONTPATH/fonts.scale + mkfontscale $XTTFFONTPATH # Update fonts.dir, encodings.dir is needed for the sake of xfs. + rm -f $XTTFFONTPATH/fonts.dir if [ -r $XTTFFONTPATH/../encodings/large/encodings.dir ]; then mkfontdir -e $XTTFFONTPATH/../encodings/large $XTTFFONTPATH else