Re: Debian 3.0 (woody) 版中文化
On Sun, May 13, 2001 at 06:03:22PM +0800, Edward G.J. Lee wrote:
> pdflatex 可能可以用,但 cjk-latex + dvips 可能就不一定了,因为字型并
> 非使用 CJK 编码。
>
> cjk.pfb(由 ttf2pfb 所产生的)
> ...
> dup 0/cjkC4EB put
> dup 1/cjkC4EC put
> dup 2/cjkC4ED put
> ...
>
> non-cjk.pfb(由 ttf2pt1 所产生的)
> ...
> dup 0 /c0 put
> dup 1 /c1 put
> dup 2 /c2 put
> ...
> 不晓得是 dvips 的问题,还是 ttf2pt1 的问题。ttf2pfb 会预设产生
> CJK 编码的字型,所以很容易就可以被 cjk-latex + dvips 使用。如
> 果由 pfaedit 很容易就看出两者不同,不知道是不是这个原因?
ttf2pt1 似乎硬要用 latin1 (iso8859-1) 编码的字型名称,不知这个是否我的
致命伤? :-) 大概是时候玩玩 ttf2pt1 的原始码了。 :-|
> 相反的,由 ttf2pfb 做出来的 CJK 编码字型,却无法被 pdflatex 使
> 用,这下怎么办?:-(
> Error: pdflatex (file aming01.pfb): unexpected end of file
请问你用 ttf2pfb 处理文鼎字型时,是用什么指令的?你用的字型是
bsmi00lp.ttf 吗?因为我不知道如何叫 ttf2pfb 读 Unicode 编码的
gkai00mp.ttf 而制出 CJK LaTeX 使用的 map。
> 比较之下,由 ttf2pt1 自 Unicode 文鼎 TTF 做出来的字型,编译出 pdf
> 档时,字型品质明显差一点,可能是我还不熟悉 ttf2pt1 的关系。
> 我的制作方式:
> ttf2pt1 -b -A -e -L cubig5.map+01 aming.ttf aming01
> * 我的 ttf2pt1 是 link 至 freetype2 的。而 ttf2pfb 则是 link 至
> freetype1。
我的 ttf2pt1 (3.3.3) 沿用 ttf2pt1 自带的 ttf engine (我今次懒,没有
link FreeType 2。 /usr/bin/ttf2pfb 跟你一样,都是连至 FreeType 1.x
(即 libttf.so.2)。
> foka 兄能否说明您制作过程?谢谢!
# 制作字型档:
for i in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 \
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35; do
./ttf2pt1 -L maps/cugb.map+$i gkai00mp.ttf gkai$i
./t1asm -b gkai$i.t1a gkai$1.pfb
done
其中 "t1asm",在我的系统上有三个版本:
ttf2pt1 内附的 t1asm, ttf2pfb 附的 t1asm (在 Debian 上是
/usr/bin/t1asm-freetype),和 t1utils 套件里的 t1asm (最新版,
Debian 上是 /usr/bin/t1asm)。我三者都试过,似乎效果相同。唔……
ttf2pfb 的 t1asm (t1asm-freetype),Werner Lemberg 加了个 patch,
以帮助 dvips 的 partial font downloading。但那是两年多前的事了,
可能现今的 dvips 已经够聪明?不知道。
然后,把字型复制至适档的目录里:
cp gkai??.afm /usr/share/texmf/fonts/afm/arphic/gkai00mp/
cp gkai??.tfm /usr/share/texmf/fonts/tfm/arphic/gkai00mp/
cp gkai??.pfb /usr/share/texmf/fonts/type1/arphic/gkai00mp/
(注:这是为了方便测试嘛!不过其实我可能应该把这些放在
/usr/local/share/texmf 底下。另外,这样会把 tfm-arphic-gkai00mp 套件
原有的一些 gkai??.tfm 档覆写掉,所以我先做了备份。)
然后修改或添加以下档案:
/usr/share/texmf/tex/latex/CJK/GB/c10gkai.fd
\def\fileversion{4.2.0}
\def\filedate{1998/12/13}
\ProvidesFile{c10gkai.fd}[\filedate\space\fileversion]
% simplified Chinese characters in GuoBiao encoding scheme.
% Arphic PL TrueType font "AR PL KaitiM GB"
%\DeclareFontFamily{C10}{gkai}{}
\DeclareFontFamily{C10}{gkai}{\hyphenchar \font\m@ne}
\DeclareFontShape{C10}{gkai}{m}{n}{<-> CJK * gkai}{}
\DeclareFontShape{C10}{gkai}{m}{sl}{<-> CJK * gkais}{}
\DeclareFontShape{C10}{gkai}{m}{it}{<-> CJKssub * gkai/m/sl}{}
\DeclareFontShape{C10}{gkai}{bx}{n}{<-> CJKb * gkai}{\CJKbold}
\DeclareFontShape{C10}{gkai}{bx}{sl}{<-> CJKb * gkais}{\CJKbold}
\DeclareFontShape{C10}{gkai}{bx}{it}{<-> CJKssub * kai/bx/sl}{\CJKbold}
\endinput
对了,那个 {\hyphenchar \font\m@ne} 是干什么的?我以前一向都没有加。 :-)
/etc/texmf/dvips/arphic.map:
gkai01 Gkai01 <gkai01.pfb
gkai02 Gkai02 <gkai02.pfb
gkai03 Gkai03 <gkai03.pfb
...
gkais01 Gkai01 " .167 SlantFont " <gkai01.pfb
gkais02 Gkai02 " .167 SlantFont " <gkai02.pfb
gkais03 Gkai03 " .167 SlantFont " <gkai03.pfb
...
等等。也就是说,可以很容易制作斜体字了。 :-) 不过要加上对应的
gkais??.tfm 档。我暂时只是把 gkai??.tfm 复制为 gkais??.tfm,横竖它们
的字宽是相同的。 :-) 但将来应该用更正统的方法解决。直排?我就不知道
简单的方法了。不知 cwTeX 和 ChiTeX 是如何办到的。 ttf2pk 可以旋转字型,
但基本上是另制一套 *pk 档。唔……
/etc/texmf/dvips/config.arphic:
p +arphic.map
/etc/texmf/pdftex/pdftex.cfg 的档末加了:
map +arphic.map
然后执行 mktexlsr 就是了。
我试了 CJK-LaTeX 里的 GB.tex,稍作了修改,用 "gkai" 字型:
latex GB.tex
dvips -P arphic -P cmz GB.dvi -o
gv GB.ps
gs GB.ps
gv 和 gs 的效果相同,中文字都以 Courier 代替了,只是 gs 更显示了什么
地方出错(gs 往别处找 gkai 字型干嘛?)
反之, pdflatex 出来的效果却是完美的:
pdflatex GB.tex
acroread GB.pdf
xpdf GB.pdf
acroread 和 xpdf 都能顺利读到这个 PDF 档,显示漂亮的文鼎楷书字型。 :-)
有空也可以问问 Werner Lemberg (CJK for LaTeX 的作者; FreeType 的
co-author,等等)。另外,相信陈老师或王老师也可能知道解决方法。 :-)
P.S. Werner 似乎出了 CJK 4.4.0 = TeXLife6-CJK.tar.bz2,在
http://cjk.ffii.org/ 上有连结。我下载了,未玩。 :-)
东东
--
Anthony Fok Tung-Ling Civil and Environmental Engineering
foka@ualberta.ca, foka@debian.org University of Alberta, Canada
Debian GNU/Linux Chinese Project -- http://www.debian.org/intl/zh/
Come visit Our Lady of Victory Camp -- http://www.olvc.ab.ca/
--
| This message was re-posted from debian-chinese-big5@lists.debian.org
| and converted from big5 to gb2312 by an automatic gateway.
Reply to: