From de0cdb9f9e41cc092b33c46df94ce45ef26910ad Mon Sep 17 00:00:00 2001 From: Jing-Tang Keith Jang Date: Sat, 9 Dec 2000 20:09:35 +0000 Subject: [PATCH] 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. --- chinese/moettf/Makefile | 69 +++++++++++++++++++------ chinese/moettf/distinfo | 4 +- chinese/moettf/pkg-comment | 2 +- chinese/moettf/pkg-deinstall | 29 +++++++---- chinese/moettf/pkg-descr | 10 ++-- chinese/moettf/pkg-install | 99 ++++++++++++++++++++---------------- chinese/moettf/pkg-plist | 13 ++--- 7 files changed, 146 insertions(+), 80 deletions(-) diff --git a/chinese/moettf/Makefile b/chinese/moettf/Makefile index 8e320f4bad53..78a2209b3983 100644 --- a/chinese/moettf/Makefile +++ b/chinese/moettf/Makefile @@ -6,46 +6,85 @@ # PORTNAME= moettf -PORTVERSION= 1.0 +PORTVERSION= 2.0 CATEGORIES= chinese x11-fonts -MASTER_SITES= ftp://ftp.cc.ntut.edu.tw/OS/Linux/packages/chinese/fonts/twmoefont/ttf/ \ - ftp://ftp.ncu.edu.tw/Linux/Chinese/fonts/twmoefont/ttf/ \ - ftp://www.edu.tw/download/mandr/allbook/lishu/ -DISTNAME= ${PKGNAME} -DISTFILES= moe_kai.ttf moe_sung.ttf edustd-15.exe +MASTER_SITES= ftp://www.edu.tw/download/mandr/biauword/5879/ \ + ftp://www.edu.tw/download/mandr/allbook/lishu/ \ + ftp://freebsd.sinica.edu.tw/pub/keith/moettf/ \ + ftp://ftp.cc.ntut.edu.tw/OS/Linux/packages/chinese/fonts/twmoefont/ttf/ +DISTFILES= moe_kai.ttf moe_sung.ttf edustds1.exe edustds2.exe edustd-15.exe MAINTAINER= keith@FreeBSD.org BUILD_DEPENDS= unrar:${PORTSDIR}/archivers/unrar -LIB_DEPENDS= font.1:${PORTSDIR}/x11-servers/XttXF86srv-common +RUN_DEPENDS= ttfm.sh:${PORTSDIR}/chinese/ttfm -USE_X_PREFIX= yes +USE_XLIB= yes DIST_SUBDIR= zh-moettf +NO_CDROM= "Contact Taiwan's Ministry of Education for commercial use." NO_BUILD= yes -NO_CDROM= "Contact Taiwan Ministry of Education for commercial use." SHAREMODE= 644 -FONTDIR= ${PREFIX}/lib/X11/fonts/TrueType +FONTDIR= ${PREFIX}/share/fonts/TrueType +XFONTDIR= ${X11BASE}/lib/X11/fonts/TrueType +INSTALL_ENV= PKG_PREFIX=${PREFIX} XFREE86_VERSION=${XFREE86_VERSION} \ + DEFAULT=${DEFAULT} WANT_CJK=${WANT_CJK} WANT_GS6=${WANT_GS6} \ + WITHOUT_X=${WITHOUT_X} .include +.if defined(WANT_CJK) +RUN_DEPENDS+= bg5latex:${PORTSDIR}/chinese/CJK +.endif +.if defined(WANT_GS6) +RUN_DEPENDS+= ${LOCALBASE}/share/ghostscript/CJK/CMap/B5pc-H:${PORTSDIR}/chinese/ghostscript6 +.endif +.if ${XFREE86_VERSION} == 3 && !defined(WITHOUT_X) +RUN_DEPENDS+= mkfontdir.pl:${PORTSDIR}/x11-servers/XttXF86srv-common +.endif + +pre-fetch: +.if defined(WANT_CJK) + @${ECHO} "CJK support will be added." +.endif +.if defined(WANT_GS6) + @${ECHO} "Ghostscript6 support will be added." +.endif +.if defined(WITHOUT_X) + @${ECHO} "X Window support will NOT be added." +.endif +.if defined(DEFAULT) + @${ECHO} "MOETTF will be set as default font." +.endif +.if !defined(WANT_CJK) && !defined(WANT_GS6) && !defined(WITHOUT_X) && !defined(DEFAULT) + @${ECHO} -- + @${ECHO} "Type \"make WANT_CJK=yes\" if you want CJK support." + @${ECHO} "Type \"make WANT_GS6=yes\" if you want Ghostscript6 support." + @${ECHO} "Type \"make WITHOUT_X=yes\" if you DONT want X Window support." + @${ECHO} "Type \"make DEFAULT=yes\" to set MOETTF the default font." + @${ECHO} "You can use them in combinations." + @${ECHO} -- +.endif + do-extract: @${RM} -rf ${WRKDIR} @${MKDIR} ${WRKDIR} @unrar x ${DISTDIR}/${DIST_SUBDIR}/edustd-15.exe ${WRKDIR} @${MV} ${WRKDIR}/Edustd-15.TTF ${WRKDIR}/moe_lishu.ttf + @unrar x ${DISTDIR}/${DIST_SUBDIR}/edustds1.exe ${WRKDIR} + @${MV} ${WRKDIR}/edustds1.ttf ${WRKDIR}/moe_sungext.ttf + @unrar x ${DISTDIR}/${DIST_SUBDIR}/edustds2.exe ${WRKDIR} + @${MV} ${WRKDIR}/edustds2.ttf ${WRKDIR}/moe_sungsym.ttf do-install: .if !exists(${FONTDIR}) - @${ECHO} "=========================================================" - @${ECHO} "Please add ${FONTDIR} to your font path" - @${ECHO} "in /etc/XF86Config." - @${ECHO} "=========================================================" @${MKDIR} ${FONTDIR} .endif @${INSTALL_DATA} ${WRKDIR}/moe_lishu.ttf ${FONTDIR} @${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/moe_kai.ttf ${FONTDIR} @${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/moe_sung.ttf ${FONTDIR} - @${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL + @${INSTALL_DATA} ${WRKDIR}/moe_sungext.ttf ${FONTDIR} + @${INSTALL_DATA} ${WRKDIR}/moe_sungsym.ttf ${FONTDIR} + @${SETENV} ${INSTALL_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL .include diff --git a/chinese/moettf/distinfo b/chinese/moettf/distinfo index dfcf3fd9e6a6..d04fb1eb4847 100644 --- a/chinese/moettf/distinfo +++ b/chinese/moettf/distinfo @@ -1,3 +1,5 @@ -MD5 (zh-moettf/edustd-15.exe) = 89ccf18a6dabe874026922965910ee3d MD5 (zh-moettf/moe_kai.ttf) = bcbd6cf83b87153f9a725243afe210c7 MD5 (zh-moettf/moe_sung.ttf) = 6bf81e29d64db09d94bb1f03c041d9b2 +MD5 (zh-moettf/edustds1.exe) = 58d635e26ea8dc2a5103a03ab8f8d7b2 +MD5 (zh-moettf/edustds2.exe) = 883ad85335d6eee2d4ec8a6c9b0a08d8 +MD5 (zh-moettf/edustd-15.exe) = 89ccf18a6dabe874026922965910ee3d diff --git a/chinese/moettf/pkg-comment b/chinese/moettf/pkg-comment index 538e42f6788a..f67cc1e6b9fe 100644 --- a/chinese/moettf/pkg-comment +++ b/chinese/moettf/pkg-comment @@ -1 +1 @@ -Three Chinese BIG5 TrueType fonts: Kai LiShu Sung +Three Chinese BIG5 TrueType fonts: Kai LiShu Sung SungExt diff --git a/chinese/moettf/pkg-deinstall b/chinese/moettf/pkg-deinstall index 8d161a41b09b..64fb4b8d3146 100644 --- a/chinese/moettf/pkg-deinstall +++ b/chinese/moettf/pkg-deinstall @@ -1,17 +1,24 @@ #!/bin/sh + if [ "$2" != "DEINSTALL" ]; then exit 0 fi -FONTDIR=${PKG_PREFIX}/lib/X11/fonts/TrueType -cd ${FONTDIR} -# Restore fonts.dir -sed -e '/-moe-/d' -e '/-twmoe-/d' fonts.dir > fonts.dir.tmp -numfonts=$(echo $(cat fonts.dir.tmp | wc -l) - 1 | bc) -echo ${numfonts} > fonts.dir -sed -e 1d fonts.dir.tmp >> fonts.dir -rm -f fonts.dir.tmp +PKGNAME=$1 +PREFIX=${PKG_PREFIX} +TTFM=${PKG_PREFIX}/bin/ttfm.sh -# Restore fonts.alias -sed -e '/^-moe-/d' -e '/^-twmoe-/d' fonts.alias > fonts.alias.tmp -mv -f fonts.alias.tmp fonts.alias +FONTDIR=${PREFIX}/share/fonts/TrueType +FONTS="moe_lishu.ttf moe_kai.ttf moe_sung.ttf moe_sungext.ttf moe_sungsym.ttf" + +if [ -r $FONTDIR/$PKGNAME ]; then + for i in `cat $FONTDIR/$PKGNAME`; do + for f in $FONTS $DEFAULTMING $DEFAULTKAI; do + $TTFM --remove $i $f + done + done +fi + +rm -f $FONTDIR/$PKGNAME + +exit 0 diff --git a/chinese/moettf/pkg-descr b/chinese/moettf/pkg-descr index 030c21017210..233162350cb2 100644 --- a/chinese/moettf/pkg-descr +++ b/chinese/moettf/pkg-descr @@ -1,3 +1,7 @@ -This port installs Chinese BIG5 TrueType fonts, includes Kai/LiShu/Sung -fonts. It then can be used along with X Window System or typesetting -software like CJK. Restricted usage: end user and non-commericial only. +This port installs Chinese BIG5 TrueType fonts, includes +Kai/Li Shu/Sung Extension/Sung Symbol/Sung fonts. It then +can be used along with X Window System or typesetting +software like CJK. + +Restricted usage: +For commercial use, contact Taiwan Ministry of Education. diff --git a/chinese/moettf/pkg-install b/chinese/moettf/pkg-install index 7dafd5904d28..2fee3f534597 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 -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 +TEMPFILE=`mktemp -q /tmp/moettf.XXXX` +XFONTDIR=/usr/X11R6/lib/X11/fonts/TrueType -# 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 +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_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 diff --git a/chinese/moettf/pkg-plist b/chinese/moettf/pkg-plist index 9c569c226db3..f4e4f166ee6e 100644 --- a/chinese/moettf/pkg-plist +++ b/chinese/moettf/pkg-plist @@ -1,6 +1,7 @@ -lib/X11/fonts/TrueType/moe_kai.ttf -lib/X11/fonts/TrueType/moe_lishu.ttf -lib/X11/fonts/TrueType/moe_sung.ttf -@unexec if [ `wc -c %D/lib/X11/fonts/TrueType/fonts.dir | awk '{print $1}'` = 2 ]; then rm -f %D/lib/X11/fonts/TrueType/fonts.dir; fi -@unexec if [ ! -s %D/lib/X11/fonts/TrueType/fonts.alias ]; then rm -f %D/lib/X11/fonts/TrueType/fonts.alias; fi -@unexec rmdir %D/lib/X11/fonts/TrueType 2>/dev/null || true +share/fonts/TrueType/moe_kai.ttf +share/fonts/TrueType/moe_lishu.ttf +share/fonts/TrueType/moe_sung.ttf +share/fonts/TrueType/moe_sungext.ttf +share/fonts/TrueType/moe_sungsym.ttf +@unexec rmdir %D/share/fonts/TrueType 2>/dev/null || true +@unexec rmdir %D/share/fonts 2>/dev/null || true