diff options
author | steve <steve@FreeBSD.org> | 2000-01-24 14:28:34 +0800 |
---|---|---|
committer | steve <steve@FreeBSD.org> | 2000-01-24 14:28:34 +0800 |
commit | 7fd16f60a6124924e769d3e4116a963281d3a435 (patch) | |
tree | 9c469ee4042c9ef4a34a2f08d75714523c700c31 /chinese/CJK/scripts | |
parent | 83677861cc7236cffe0ac45193aa3b424c175f4a (diff) | |
download | freebsd-ports-gnome-7fd16f60a6124924e769d3e4116a963281d3a435.tar.gz freebsd-ports-gnome-7fd16f60a6124924e769d3e4116a963281d3a435.tar.zst freebsd-ports-gnome-7fd16f60a6124924e769d3e4116a963281d3a435.zip |
Fromm maintainer:
1. Change freetype-1.2 to freetype-1.3 in post-install, so
it can find freetype sources to build ttf2pk & ttf2tfm.
2. It no longer uses moettf, but Arphic ttf instead, which
has no character loss and IMHO much more beautiful. :)
3. Generates GB tfms from Arphic fonts.
4. Update maintainer's address.
PR: 16042
Submitted by: maintainer
Diffstat (limited to 'chinese/CJK/scripts')
-rw-r--r-- | chinese/CJK/scripts/post-install | 202 | ||||
-rw-r--r-- | chinese/CJK/scripts/pre-build | 26 |
2 files changed, 100 insertions, 128 deletions
diff --git a/chinese/CJK/scripts/post-install b/chinese/CJK/scripts/post-install index 00544833c309..720d44639094 100644 --- a/chinese/CJK/scripts/post-install +++ b/chinese/CJK/scripts/post-install @@ -1,166 +1,134 @@ #!/bin/sh PATH=/bin:/usr/bin:/usr/local/bin +TEXMFMAIN=`kpsexpand '$TEXMFMAIN'` + # Some mktexpk incorrectly calls ttf2pk with -p option, delete it. -cp ${PREFIX}/bin/mktexpk ${PREFIX}/bin/mktexpk.CJK -sed -e "s/ttf2pk -p/ttf2pk/" ${PREFIX}/bin/mktexpk.CJK > ${PREFIX}/bin/mktexpk -rm ${PREFIX}/bin/mktexpk.CJK +if [ ! -z "`grep "ttf2pk -p" ${PREFIX}/bin/mktexpk`" ] +then + cp ${PREFIX}/bin/mktexpk ${PREFIX}/bin/mktexpk.CJK + sed -e "s/ttf2pk -p/ttf2pk/" ${PREFIX}/bin/mktexpk.CJK > ${PREFIX}/bin/mktexpk + rm ${PREFIX}/bin/mktexpk.CJK +fi -# Install ttf2pk binary in ${PORTSDIR}/print/freetype, data in ${TEXMF}/ttf2pk -(cd ${PORTSDIR}/print/freetype/work/freetype-1.2/contrib/ttf2pk; +# Install ttf2pk binary in ${PORTSDIR}/print/freetype, data in ${TEXMF}/ttf2pk, +# and link ${TEXMF}/ttf2tfm to ${TEXMF}/ttf2pk. +(cd ${PORTSDIR}/print/freetype/work/freetype-1.3/contrib/ttf2pk; ./configure --prefix=${PREFIX} --with-kpathsea-dir=${PREFIX}; make depend all install; - cp -R data ${PREFIX}/share/texmf/ttf2pk; - cd ${PREFIX}/share/texmf; ln -s ttf2pk ttf2tfm; ) - -# We have no way telling where generated fonts are, but ask the user. -echo -echo "Please input where generated fonts are placed." -echo "It's specified as VARTEXFONTS in your texmf.cnf." -echo "->(Default: /var/tmp/texfonts)" -read VARTEXFONTS -if [ -z ${VARTEXFONTS} ] -then - VARTEXFONTS=/var/tmp/texfonts -fi + rm -fr ${TEXMFMAIN}/ttf2pk ${TEXMFMAIN}/ttf2tfm; + cp -R data ${TEXMFMAIN}/ttf2pk; + cd ${TEXMFMAIN}; ln -s ttf2pk ttf2tfm; ) -# teTeX no longer makes VARTEXFONTS. -mkdir -p ${VARTEXFONTS}/pk -mkdir -p ${VARTEXFONTS}/tfm +# Install Arphic TTF fonts +mkdir -p ${TEXMFMAIN}/fonts/truetype/arphic +ln -s ${X11BASE}/lib/X11/fonts/TrueType/bkai00mp.ttf ${TEXMFMAIN}/fonts/truetype/arphic/arb5_kai.ttf +ln -s ${X11BASE}/lib/X11/fonts/TrueType/bsmi00lp.ttf ${TEXMFMAIN}/fonts/truetype/arphic/arb5_sung.ttf +ln -s ${X11BASE}/lib/X11/fonts/TrueType/gbsn00lp.ttf ${TEXMFMAIN}/fonts/truetype/arphic/argb_sung.ttf +ln -s ${X11BASE}/lib/X11/fonts/TrueType/gkai00mp.ttf ${TEXMFMAIN}/fonts/truetype/arphic/argb_kai.ttf -# Chmod 1777 ${VARTEXFONTS}. -if [ -z "${NOCHMOD}" ] +# fontname/special.map: add arb5kai/arb5sung/argbkai/argbsung entries. +if [ -n "`grep arb5kai ${TEXMFMAIN}/fontname/special.map`" ] then - chmod -R 1777 ${VARTEXFONTS} + echo Seems arb5kai already in special.map, file untouched. +else + echo "@c Arphic BIG5 Kaiti TTF" >> ${TEXMFMAIN}/fontname/special.map + echo "arb5kai big5 arb5kai" >> ${TEXMFMAIN}/fontname/special.map fi - -# Install moe_* TTF fonts -echo === -echo If you want to install other TTF fonts, you have to manually edit: -echo ${PREFIX}/share/texmf/fontname/special.map -echo ${PREFIX}/share/texmf/ttf2pk/ttfonts.map -echo ${PREFIX}/share/texmf/web2c/texmf.cnf -echo ${PREFIX}/share/texmf/tex/latex/CJK/Bg5/c00kai.fd, for Kai family fonts. -echo ${PREFIX}/share/texmf/tex/latex/CJK/Bg5/c00song.fd, for Song family fonts. -echo ${PREFIX}/share/texmf/tex/latex/CJK/Bg5/c00lishu.fd, for LiShu family fonts. -echo === -mkdir -p ${PREFIX}/share/texmf/fonts/truetype/moe -ln -s ${X11BASE}/lib/X11/fonts/TrueType/moe_*.ttf ${PREFIX}/share/texmf/fonts/truetype/moe - -# fontname/special.map -if [ -n "`grep moekai ${PREFIX}/share/texmf/fontname/special.map`" ] +if [ -n "`grep arb5sung ${TEXMFMAIN}/fontname/special.map`" ] then - echo Seems moekai already in special.map, file untouched. + echo Seems arb5sung already in special.map, file untouched. else - echo "@c BIG5 MOE TTF fonts" >> ${PREFIX}/share/texmf/fontname/special.map - echo "moekai big5 moekai" >> ${PREFIX}/share/texmf/fontname/special.map + echo "@c Arphic BIG5 Mingti TTF" >> ${TEXMFMAIN}/fontname/special.map + echo "arb5sung big5 arb5sung" >> ${TEXMFMAIN}/fontname/special.map fi -if [ -n "`grep moesung ${PREFIX}/share/texmf/fontname/special.map`" ] +if [ -n "`grep argbkai ${TEXMFMAIN}/fontname/special.map`" ] then - echo Seems moesung already in special.map, file untouched. + echo Seems argbkai already in special.map, file untouched. else - echo "@c BIG5 MOE TTF fonts" >> ${PREFIX}/share/texmf/fontname/special.map - echo "moesung big5 moesung" >> ${PREFIX}/share/texmf/fontname/special.map + echo "@c Arphic GB Kaiti TTF" >> ${TEXMFMAIN}/fontname/special.map + echo "argbkai gb argbkai" >> ${TEXMFMAIN}/fontname/special.map fi -if [ -n "`grep moelishu ${PREFIX}/share/texmf/fontname/special.map`" ] +if [ -n "`grep argbsung ${TEXMFMAIN}/fontname/special.map`" ] then - echo Seems moelishu already in special.map, file untouched. + echo Seems argbsung already in special.map, file untouched. else - echo "@c BIG5 MOE TTF fonts" >> ${PREFIX}/share/texmf/fontname/special.map - echo "moelishu big5 moelishu" >> ${PREFIX}/share/texmf/fontname/special.map + echo "@c Arphic GB Sungti TTF" >> ${TEXMFMAIN}/fontname/special.map + echo "argbsung gb argbsung" >> ${TEXMFMAIN}/fontname/special.map fi -# ttf2pk/ttfonts.map -if [ -n "`grep moekai ${PREFIX}/share/texmf/ttf2pk/ttfonts.map`" ] +# ttf2pk/ttfonts.map: add arb5kai/arb5sung/argbkai/argbsung entries. +if [ -n "`grep arb5kai ${TEXMFMAIN}/ttf2pk/ttfonts.map`" ] then - echo Seems moekai already in ttfonts.map, file untouched. + echo Seems arb5kai already in ttfonts.map, file untouched. else - echo "moekai@Big5.sfd@ moe_kai Pid=3 Eid=4" >> ${PREFIX}/share/texmf/ttf2pk/ttfonts.map + echo "arb5kai@UBig5@ arb5_kai Pid=3 Eid=1" >> ${TEXMFMAIN}/ttf2pk/ttfonts.map fi -if [ -n "`grep moesung ${PREFIX}/share/texmf/ttf2pk/ttfonts.map`" ] +if [ -n "`grep arb5sung ${TEXMFMAIN}/ttf2pk/ttfonts.map`" ] then - echo Seems moesung already in ttfonts.map, file untouched. + echo Seems arb5sung already in ttfonts.map, file untouched. else - echo "moesung@Big5.sfd@ moe_sung Pid=3 Eid=4" >> ${PREFIX}/share/texmf/ttf2pk/ttfonts.map + echo "arb5sung@UBig5@ arb5_sung Pid=3 Eid=1" >> ${TEXMFMAIN}/ttf2pk/ttfonts.map fi -if [ -n "`grep moelishu ${PREFIX}/share/texmf/ttf2pk/ttfonts.map`" ] +if [ -n "`grep argbkai ${TEXMFMAIN}/ttf2pk/ttfonts.map`" ] then - echo Seems moelishu already in ttfonts.map, file untouched. + echo Seems argbkai already in ttfonts.map, file untouched. else - echo "moelishu@Big5.sfd@ moe_lishu Pid=3 Eid=4" >> ${PREFIX}/share/texmf/ttf2pk/ttfonts.map + echo "argbkai@UGB@ argb_kai Pid=3 Eid=1" >> ${TEXMFMAIN}/ttf2pk/ttfonts.map fi - -# web2c/texmf.cnf -if [ -n "`grep TTF2PKINPUTS ${PREFIX}/share/texmf/web2c/texmf.cnf`" ] +if [ -n "`grep argbsung ${TEXMFMAIN}/ttf2pk/ttfonts.map`" ] then - echo Seems TTF2PKINPUTS already set in texmf.cnf, file untouched. + echo Seems argbsung already in ttfonts.map, file untouched. else - echo "% ttf2pk data directory" >> ${PREFIX}/share/texmf/web2c/texmf.cnf - echo "TTF2PKINPUTS = \$TEXMF/ttf2pk//" >> ${PREFIX}/share/texmf/web2c/texmf.cnf -fi -if [ -n "`grep TTF2TFMINPUTS ${PREFIX}/share/texmf/web2c/texmf.cnf`" ] -then - echo Seems TTF2TFMINPUTS already set in texmf.cnf, file untouched. -else - echo "% ttf2tfm data directory" >> ${PREFIX}/share/texmf/web2c/texmf.cnf - echo "TTF2TFMINPUTS = \$TEXMF/ttf2tfm//" >> ${PREFIX}/share/texmf/web2c/texmf.cnf + echo "argbsung@UGB@ argb_sung Pid=3 Eid=1" >> ${TEXMFMAIN}/ttf2pk/ttfonts.map fi -# tex/latex/CJK/Bg5/c00kai.fd -if [ -n "`grep moekai ${PREFIX}/share/texmf/tex/latex/CJK/Bg5/c00kai.fd`" ] +# web2c/texmf.cnf +if [ -n "`grep TTF2PKINPUTS ${TEXMFMAIN}/web2c/texmf.cnf`" ] then - echo Seems moekai already in c00kai.fd, file untouched. + echo Seems TTF2PKINPUTS already set in texmf.cnf, file untouched. else - (cd ${PREFIX}/share/texmf/tex/latex/CJK/Bg5; - cp c00kai.fd c00kai.fd.orig; - sed -e "s/b5ka12/moekai/" c00kai.fd.orig > c00kai.fd; - ) + echo "% ttf2pk data directory" >> ${TEXMFMAIN}/web2c/texmf.cnf + echo "TTF2PKINPUTS = \$TEXMF/ttf2pk//" >> ${TEXMFMAIN}/web2c/texmf.cnf fi - -# tex/latex/CJK/Bg5/c00song.fd -if [ -n "`grep moesung ${PREFIX}/share/texmf/tex/latex/CJK/Bg5/c00song.fd`" ] +if [ -n "`grep TTF2TFMINPUTS ${TEXMFMAIN}/web2c/texmf.cnf`" ] then - echo Seems moesung already in c00song.fd, file untouched. + echo Seems TTF2TFMINPUTS already set in texmf.cnf, file untouched. else - (cd ${PREFIX}/share/texmf/tex/latex/CJK/Bg5; - cp c00song.fd c00song.fd.orig; - sed -e "s/CJKsub \* kai\/m\/n/CJK \* moesung/" c00song.fd.orig > c00song.fd; - mv c00song.fd c00song.fd.tmp; - sed -e "s/CJKsub \* kai\/bx\/n/CJKb \* moesung/" c00song.fd.tmp > c00song.fd; - rm c00song.fd.tmp; - ) + echo "% ttf2tfm data directory" >> ${TEXMFMAIN}/web2c/texmf.cnf + echo "TTF2TFMINPUTS = \$TEXMF/ttf2tfm//" >> ${TEXMFMAIN}/web2c/texmf.cnf fi -rm ${PREFIX}/share/texmf/tex/latex/CJK/Bg5/c00lishu.fd.orig +# Clean redundant files created during patch phase. +rm -f ${TEXMFMAIN}/tex/latex/CJK/Bg5/c00kai.fd.orig +rm -f ${TEXMFMAIN}/tex/latex/CJK/Bg5/c00song.fd.orig +rm -f ${TEXMFMAIN}/tex/latex/CJK/GB/c10kai.fd.orig +rm -f ${TEXMFMAIN}/tex/latex/CJK/GB/c10song.fd.orig -# Generate tfm fonts for moekai/moesung/moelishu. -texconfig rehash # Update ls-R -mkdir -p ${VARTEXFONTS}/tfm/moe/moekai ${VARTEXFONTS}/tfm/moe/moesung ${VARTEXFONTS}/tfm/moe/moelishu -(cd ${VARTEXFONTS}/tfm/moe/moekai; ttf2tfm moe_kai -P 3 -E 4 moekai@Big5@) -(cd ${VARTEXFONTS}/tfm/moe/moesung; ttf2tfm moe_sung -P 3 -E 4 moesung@Big5@) -(cd ${VARTEXFONTS}/tfm/moe/moelishu; ttf2tfm moe_lishu -P 3 -E 4 moelishu@Big5@) +# Generate tfm fonts for Arphic TTFs. +mkdir -p ${TEXMFMAIN}/fonts/tfm/arphic/arb5kai ${TEXMFMAIN}/fonts/tfm/arphic/arb5sung ${TEXMFMAIN}/fonts/tfm/arphic/argbkai ${TEXMFMAIN}/fonts/tfm/arphic/argbsung +(cd ${TEXMFMAIN}/fonts/tfm/arphic/arb5kai; ttf2tfm ${TEXMFMAIN}/fonts/truetype/arphic/arb5_kai -P 3 -E 1 arb5kai@${TEXMFMAIN}/ttf2pk/UBig5@) +(cd ${TEXMFMAIN}/fonts/tfm/arphic/arb5sung; ttf2tfm ${TEXMFMAIN}/fonts/truetype/arphic/arb5_sung -P 3 -E 1 arb5sung@${TEXMFMAIN}/ttf2pk/UBig5@) +(cd ${TEXMFMAIN}/fonts/tfm/arphic/argbkai; ttf2tfm ${TEXMFMAIN}/fonts/truetype/arphic/argb_kai -P 3 -E 1 argbkai@${TEXMFMAIN}/ttf2pk/UGB@) +(cd ${TEXMFMAIN}/fonts/tfm/arphic/argbsung; ttf2tfm ${TEXMFMAIN}/fonts/truetype/arphic/argb_sung -P 3 -E 1 argbsung@${TEXMFMAIN}/ttf2pk/UGB@) -# Update ${TEXMF} tree +# Update ls-R texconfig rehash # Messages to the user -echo "----------------------------------------------------------------------" -echo "CJK is now installed. Here are final notes for BIG5 users:" -echo -echo "Use 'bg5latex' instead of 'latex'. You may run 'bg5latex Big5.tex'" -echo "to check its output. CJK.doc & commands.doc are good starting" -echo "points." -echo -echo "FYI, moe_kai.ttf has some characters lost. These includes:" -echo " 0xb9a6 0xbcb5 0xd974 0xdb57 0xdd7c 0xe0b5 0xe2e9 0xe351" -echo " 0xe3c4 0xe5bf 0xe5c1 0xe7ec 0xec52 0xf374 0xf6dd" +echo "-------------------------------------------------------------------------" +echo "CJK is now installed. You may use bg5latex or gbklatex wrt" +echo "BIG5 or GB encodings." echo -echo "Numerous characters are not available in moe_lishu.ttf. It's" -echo "included only for reference." -echo -echo "But moe_sung.ttf has these all. :)" -echo -echo "Thanks to Clem Chuang <b5506056@csie.ntu.edu.tw> for this info." +echo If you want to install other TTF fonts, you have to manually edit: +echo ${TEXMFMAIN}/fontname/special.map +echo ${TEXMFMAIN}/ttf2pk/ttfonts.map +echo ${TEXMFMAIN}/web2c/texmf.cnf +echo ${TEXMFMAIN}/tex/latex/CJK/Bg5/c00kai.fd and +echo ${TEXMFMAIN}/tex/latex/CJK/GB/c10kai.fd, for Kai family fonts. +echo ${TEXMFMAIN}/tex/latex/CJK/Bg5/c00song.fd and +echo ${TEXMFMAIN}/tex/latex/CJK/GB/c10song.fd, for Sung family fonts. +echo Then use ttf2tfm to generate corresponding tfm fonts. echo echo "Happy CJKing!" -echo "----------------------------------------------------------------------" +echo "-------------------------------------------------------------------------" diff --git a/chinese/CJK/scripts/pre-build b/chinese/CJK/scripts/pre-build index 65fe313c8035..332e03c0b34f 100644 --- a/chinese/CJK/scripts/pre-build +++ b/chinese/CJK/scripts/pre-build @@ -1,15 +1,19 @@ #!/bin/sh PATH=/bin:/usr/bin; export PATH -# -# Check to see if we have teTeX-0.9 installed, just grep ttf2pk -# in mktexpk. Not a preferred method, but it seems there is no + +# Check if teTeX is installed. +if [ ! -f ${PREFIX}/share/texmf/doc/tetex/README ]; then + echo "-----------------------------------------" + echo "teTeX is not installed!" + echo "It's recommended to use CJK upon teTeX!" + echo "-----------------------------------------" + exit 1 +# Juse grep for 1.0 is not a preferred method, but it seems there is no # other way solving this. -# -if [ -z "`head -1 ${PREFIX}/share/texmf/doc/tetex/README |grep 1\.0`" ] -then - echo "-------------------------------------------" - echo " You do not have teTeX-1.0 installed!" - echo " CJK 4.3.0 needs that to function properly." - echo "-------------------------------------------" - exit 1 +elif [ -z "`head -1 ${PREFIX}/share/texmf/doc/tetex/README |grep 1\.0`" ]; then + echo "-------------------------------------------" + echo " You do not have teTeX-1.0 installed!" + echo " CJK 4.3.0 needs it to function properly." + echo "-------------------------------------------" + exit 1 fi |