freebsd-ports/chinese/moettf/pkg-install
Yen-Ming Lee 1abb6bdb77 o fix MASTER_SITES
o add new file: moe_kai_pc.ttf
  http://www.edu.tw/mandr/bbs/1-4-2/kai.htm

PR:		50091
Submitted by:	Statue <statue@freebsd.sinica.edu.tw>
Approved by:	maintainer timeout
2003-04-14 17:58:54 +00:00

65 lines
1.5 KiB
Bash

#!/bin/sh
if [ "$2" = "PRE-INSTALL" ]; then
exit 0
fi
PKGNAME=$1
PREFIX=${PKG_PREFIX}
TTFM=${PREFIX}/bin/ttfm.sh
FONTDIR=${PREFIX}/share/fonts/TrueType
FONTS="moe_lishu.ttf moe_kai.ttf moe_sung.ttf moe_sungext.ttf moe_sungsym.ttf moe_kai_pc.ttf"
if [ "X$DEFAULT" != "X" ]; then
DEFAULTMING="moe_sung.ttf"
DEFAULTKAI="moe_kai.ttf"
fi
TEMPFILE=`mktemp -q /tmp/moettf.XXXX`
XFONTDIR=${X11BASE}/lib/X11/fonts/TrueType
if [ ! -x $TTFM ]; then
echo "$TTFM not found!"
exit 1
fi
rm -f $FONTDIR/$PKGNAME
if [ "X$WANT_CJK" != "X" ]; then
# There's no CJK module now.
fi
if [ "X$WANT_GS" != "X" ]; then
for f in $FONTS; do
$TTFM --add gscjk $FONTDIR/$f
done
for f in $DEFAULTMING; do
$TTFM --setdefault gscjk $FONTDIR/$f
done
for f in $DEFAULTKAI; do
$TTFM --setdefault_kai gscjk $FONTDIR/$f
done
echo "gscjk" >> $FONTDIR/$PKGNAME
fi
if [ "X$WITHOUT_X" = "X" ]; then
for f in $FONTS; do
$TTFM --add xttfm $FONTDIR/$f
done
for f in $DEFAULTMING; do
$TTFM --setdefault xttfm $FONTDIR/$f
done
for f in $DEFAULTKAI; do
$TTFM --setdefault_kai xttfm $FONTDIR/$f
done
sed -e "s/ ° ê ¦ r ¼ Ð · Ç § º Å é/twmoe_sung/g" -e "s/ t w m o e _ k a i/twmoe_kai/g" $XFONTDIR/fonts.dir > $TEMPFILE
mv $TEMPFILE $XFONTDIR/fonts.dir
sed -e "s/ ° ê ¦ r ¼ Ð · Ç § º Å é/twmoe_sung/g" -e "s/ t w m o e _ k a i/twmoe_kai/g" $XFONTDIR/fonts.alias > $TEMPFILE
mv $TEMPFILE $XFONTDIR/fonts.alias
echo "xttfm" >> $FONTDIR/$PKGNAME
fi
rm -f $TEMPFILE
exit 0