summaryrefslogtreecommitdiffstats
path: root/chinese/moettf/pkg-install
diff options
context:
space:
mode:
authorkeith <keith@FreeBSD.org>2000-12-09 20:09:35 +0000
committerkeith <keith@FreeBSD.org>2000-12-09 20:09:35 +0000
commitb306fb183be4f7796240f869ab3b660a8a9769bd (patch)
tree113f796f384025c061666314a035f5e7c8850bba /chinese/moettf/pkg-install
parent19985c79f085b55d879ec9090cd9c1c923272ec1 (diff)
downloadFreeBSD-ports-b306fb183be4f7796240f869ab3b660a8a9769bd.zip
FreeBSD-ports-b306fb183be4f7796240f869ab3b660a8a9769bd.tar.gz
Adds two new fonts, moe_sungext.ttf and moe_sungsym.ttf. Although
the fonts are encoded in BIG5, the characters and symbols are from several less commonly used layers in CNS. See http://www.edu.tw/mandr/bbs/1-4-2/1-4-2.html for more details. Also displays messages about WANT_XX when installing.
Diffstat (limited to 'chinese/moettf/pkg-install')
-rw-r--r--chinese/moettf/pkg-install105
1 files changed, 59 insertions, 46 deletions
diff --git a/chinese/moettf/pkg-install b/chinese/moettf/pkg-install
index 7dafd59..2fee3f5 100644
--- a/chinese/moettf/pkg-install
+++ b/chinese/moettf/pkg-install
@@ -1,51 +1,64 @@
#!/bin/sh
-FONTDIR=${PKG_PREFIX}/lib/X11/fonts/TrueType
+
if [ "$2" = "PRE-INSTALL" ]; then
- echo "Please add ${FONTDIR} to your /etc/XF86Config file"
exit 0
fi
-cd ${FONTDIR}
-
-echo "Updating fonts.dir & fonts.alias. This may take a while..."
-# Update fonts.dir
-touch fonts.dir
-sed -e '/ -moe-/d' -e '/ -twmoe-/d' fonts.dir > fonts.dir.tmp
-# Add 12 new fonts
-numfonts=$(echo $(cat fonts.dir.tmp |wc -l) - 1 + 12 |bc)
-if [ ${numfonts} -le 12 ]; then # fonts.dir.tmp is empty
- echo 12 > fonts.dir
-else
- echo ${numfonts} > fonts.dir
- sed -e 1d fonts.dir.tmp >> fonts.dir
+
+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"
+if [ "X$DEFAULT" != "X" ]; then
+ DEFAULTMING="moe_sung.ttf"
+ DEFAULTKAI="moe_kai.ttf"
+fi
+
+TEMPFILE=`mktemp -q /tmp/moettf.XXXX`
+XFONTDIR=/usr/X11R6/lib/X11/fonts/TrueType
+
+if [ ! -x $TTFM ]; then
+ echo "$TTFM not found!"
+ exit 1
fi
-rm -f fonts.dir.tmp
-
-# Write font information to fonts.dir
-for FAMILY in kai lishu sung
-do
- echo moe_${FAMILY}.ttf -twmoe-${FAMILY}-medium-r-normal--0-0-0-0-c-0-big5-0 >> fonts.dir
- echo ab=y:moe_${FAMILY}.ttf -twmoe-${FAMILY}-bold-r-normal--0-0-0-0-c-0-big5-0 >> fonts.dir
- echo ai=0.3:moe_${FAMILY}.ttf -twmoe-${FAMILY}-medium-i-normal--0-0-0-0-c-0-big5-0 >> fonts.dir
- echo ab=y:ai=0.3:moe_${FAMILY}.ttf -twmoe-${FAMILY}-bold-i-normal--0-0-0-0-c-0-big5-0 >> fonts.dir
-done
-
-# Update fonts.alias, font size ranges from 8 to 128.
-# Medium/Bold & Roman/Italic variations are also added.
-SIZE=8
-touch fonts.alias
-sed -e '/^-moe-/d' -e '/^-twmoe-/d' fonts.alias > fonts.alias.tmp
-mv -f fonts.alias.tmp fonts.alias
-for FAMILY in kai lishu sung
-do
- (for WEIGHT in medium bold
- do
- (for SLANT in r i
- do
- (while [ ${SIZE} -le 128 ]
- do
- echo -moe-${FAMILY}-${WEIGHT}-${SLANT}-normal--${SIZE}-`expr ${SIZE} \* 10`-0-0-c-`expr ${SIZE} \* 10`-big5-0 -twmoe-${FAMILY}-${WEIGHT}-${SLANT}-normal--${SIZE}-`expr ${SIZE} \* 10`-0-0-c-`expr ${SIZE} \* 10`-big5-0 >> fonts.alias;
- SIZE=`expr ${SIZE} + 1`;
- done) # SIZE
- done) # SLANT
- done) # WEIGHT
-done # FAMILY
+
+rm -f $FONTDIR/$PKGNAME
+
+if [ "X$WANT_CJK" != "X" ]; then
+ # There's no CJK module now.
+fi
+
+if [ "X$WANT_GS6" != "X" ]; then
+ for f in $FONTS; do
+ $TTFM --add ghostscript6 $FONTDIR/$f
+ done
+ for f in $DEFAULTMING; do
+ $TTFM --setdefault ghostscript6 $FONTDIR/$f
+ done
+ for f in $DEFAULTKAI; do
+ $TTFM --setdefault_kai ghostscript6 $FONTDIR/$f
+ done
+ echo "ghostscript6" >> $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
OpenPOWER on IntegriCloud