summaryrefslogtreecommitdiffstats
path: root/chinese
diff options
context:
space:
mode:
authorkeith <keith@FreeBSD.org>2000-12-08 16:23:16 +0000
committerkeith <keith@FreeBSD.org>2000-12-08 16:23:16 +0000
commitb0a0b6b61a32427e69b592e41260d8d8d41c3015 (patch)
treee190e4fbc5c0cf7e279a7df189d83dd268892dfa /chinese
parent57cc88c44e1827e8b1b28ee9a6d0e657dd2b3d5f (diff)
downloadFreeBSD-ports-b0a0b6b61a32427e69b592e41260d8d8d41c3015.zip
FreeBSD-ports-b0a0b6b61a32427e69b592e41260d8d8d41c3015.tar.gz
Adding supports for zh-CJK, zh-ghostscript6, and X-TT, following
zh-arphicttf's pattern. Some fonts have problems with X-TT/X-freetype, possibly due to bogus entries, including wcl-02.ttf, wcl-03.ttf, wcl-05.ttf, wcl-06.ttf, and wcl-07.ttf. The rest are displayed correctly. Further testings showed that all these fonts can't be used in GS6. It seems that the patched GS6 is confused identifying Big5 and GB TTFs, so for now only the newer Unicode-encoded TTFs can be used.
Diffstat (limited to 'chinese')
-rw-r--r--chinese/wangttf/Makefile21
-rw-r--r--chinese/wangttf/pkg-deinstall26
-rw-r--r--chinese/wangttf/pkg-install55
-rw-r--r--chinese/wangttf/pkg-plist24
4 files changed, 113 insertions, 13 deletions
diff --git a/chinese/wangttf/Makefile b/chinese/wangttf/Makefile
index 8394d4d..45a9351 100644
--- a/chinese/wangttf/Makefile
+++ b/chinese/wangttf/Makefile
@@ -18,14 +18,32 @@ MAINTAINER= keith@FreeBSD.org
RUN_DEPENDS= ttfm.sh:${PORTSDIR}/chinese/ttfm
+WANT_CJK?= NO
+WANT_GS6?= NO
+WANT_X?= YES
+
DIST_SUBDIR= zh-wangttf
USE_BZIP2= yes
+USE_XLIB= yes
NO_BUILD= yes
SHAREMODE= 644
-FONTDIR= ${PREFIX}/share/fonts/ttf
+FONTDIR= ${PREFIX}/share/fonts/TrueType
+XFONTDIR= ${X11BASE}/lib/X11/fonts/TrueType
+INSTALL_ENV= PKG_PREFIX=${PREFIX} XFREE86_VERSION=${XFREE86_VERSION} \
+ WANT_CJK=${WANT_CJK} WANT_GS6=${WANT_GS6} WANT_X=${WANT_X}
.include <bsd.port.pre.mk>
+.if ${WANT_CJK} != "NO"
+RUN_DEPENDS+= bg5latex:${PORTSDIR}/chinese/CJK
+.endif
+.if ${WANT_GS6} != "NO"
+RUN_DEPENDS+= ${LOCALBASE}/share/ghostscript/CJK/CMap/B5pc-H:${PORTSDIR}/chinese/ghostscript6
+.endif
+.if ${XFREE86_VERSION} == 3 && ${WANT_X} != "NO"
+RUN_DEPENDS+= mkfontdir.pl:${PORTSDIR}/x11-servers/XttXF86srv-common
+.endif
+
do-install:
@${MKDIR} ${FONTDIR}
.for i in ${DISTFILES}
@@ -33,5 +51,6 @@ do-install:
@${EXTRACT_CMD} -dv ${FONTDIR}/${i}
.endfor
@${INSTALL_DATA} ${FILESDIR}/wangttf.txt ${FONTDIR}
+ @${SETENV} ${INSTALL_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
.include <bsd.port.post.mk>
diff --git a/chinese/wangttf/pkg-deinstall b/chinese/wangttf/pkg-deinstall
new file mode 100644
index 0000000..41d3604
--- /dev/null
+++ b/chinese/wangttf/pkg-deinstall
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+if [ "$2" != "DEINSTALL" ]; then
+ exit 0
+fi
+
+PKGNAME=$1
+PREFIX=${PKG_PREFIX}
+TTFM=${PKG_PREFIX}/bin/ttfm.sh
+
+# No default kai & ming for wangttf.
+FONTDIR=${PREFIX}/share/fonts/TrueType
+FONTS="wcl-01.ttf wcl-02.ttf wcl-03.ttf wcl-04.ttf wcl-05.ttf \
+ wcl-06.ttf wcl-07.ttf wcl-08.ttf wcl-09.ttf wcl-10.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/wangttf/pkg-install b/chinese/wangttf/pkg-install
new file mode 100644
index 0000000..064dc1f
--- /dev/null
+++ b/chinese/wangttf/pkg-install
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+if [ "$2" = "PRE-INSTALL" ]; then
+ exit 0
+fi
+
+PKGNAME=$1
+PREFIX=${PKG_PREFIX}
+TTFM=${PREFIX}/bin/ttfm.sh
+
+# No default kai & ming for wangttf.
+FONTDIR=${PREFIX}/share/fonts/TrueType
+FONTS="wcl-01.ttf wcl-02.ttf wcl-03.ttf wcl-04.ttf wcl-05.ttf \
+ wcl-06.ttf wcl-07.ttf wcl-08.ttf wcl-09.ttf wcl-10.ttf"
+
+[ "X$WANT_X" = "X" ] && WANT_X=YES
+
+if [ ! -x $TTFM ]; then
+ echo "$TTFM not found!"
+ exit 1
+fi
+
+rm -f $FONTDIR/$PKGNAME
+
+if [ "$WANT_CJK" = "YES" -o "$WANT_CJK" = "yes" ]; then
+ # There's no CJK module now.
+fi
+
+if [ "$WANT_GS6" = "YES" -o "$WANT_GS6" = "yes" ]; 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 [ "$WANT_X" = "YES" -o "$WANT_X" = "yes" ]; 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
+ echo "xttfm" >> $FONTDIR/$PKGNAME
+fi
+
+exit 0
diff --git a/chinese/wangttf/pkg-plist b/chinese/wangttf/pkg-plist
index 8e1854a..c1ebca9 100644
--- a/chinese/wangttf/pkg-plist
+++ b/chinese/wangttf/pkg-plist
@@ -1,13 +1,13 @@
-share/fonts/ttf/wangttf.txt
-share/fonts/ttf/wcl-01.ttf
-share/fonts/ttf/wcl-02.ttf
-share/fonts/ttf/wcl-03.ttf
-share/fonts/ttf/wcl-04.ttf
-share/fonts/ttf/wcl-05.ttf
-share/fonts/ttf/wcl-06.ttf
-share/fonts/ttf/wcl-07.ttf
-share/fonts/ttf/wcl-08.ttf
-share/fonts/ttf/wcl-09.ttf
-share/fonts/ttf/wcl-10.ttf
-@unexec rmdir %D/share/fonts/ttf 2>/dev/null || true
+share/fonts/TrueType/wangttf.txt
+share/fonts/TrueType/wcl-01.ttf
+share/fonts/TrueType/wcl-02.ttf
+share/fonts/TrueType/wcl-03.ttf
+share/fonts/TrueType/wcl-04.ttf
+share/fonts/TrueType/wcl-05.ttf
+share/fonts/TrueType/wcl-06.ttf
+share/fonts/TrueType/wcl-07.ttf
+share/fonts/TrueType/wcl-08.ttf
+share/fonts/TrueType/wcl-09.ttf
+share/fonts/TrueType/wcl-10.ttf
+@unexec rmdir %D/share/fonts/TrueType 2>/dev/null || true
@unexec rmdir %D/share/fonts 2>/dev/null || true
OpenPOWER on IntegriCloud