下一页 上一页 目录

5. 打印

由于 Postscript 本身不支持 Unicode 字体,因此打印中 Unicode 支持的负担在于创建 Postscript 文档的程序,而不是 Postscript 渲染器。

我见过的现有 Postscript 字体 - .pfa/.pfb/.afm/.pfm/.gsf - 仅支持小范围的字形,而不是 Unicode 字体。

5.1 使用 TrueType 字体打印

uniprint 和 wprint 程序都能为 Unicode 纯文本生成良好的打印输出。它们需要 TrueType 字体;请参阅上面的“TrueType 字体”部分。Bitstream Cyberbit 字体效果良好。

uniprint

yudit 包中包含的 “uniprint” 程序可以将文本文件转换为 Postscript。为了让 uniprint 找到 Cyberbit 字体,请将其符号链接到 /usr/local/share/yudit/data/cyberbit.ttf

wprint

Eduardo Trapani 的 “wprint” (WorldPrint) 程序 http://ttt.esperanto.org.uy/programoj/angle/wprint.html 对 Netscape Communicator 或 Mozilla 从 HTML 页面或纯文本文件生成的 Postscript 输出进行后处理。

输出几乎是完美的;只有在西里尔字母段落中,断行不正确:行的宽度只有应有宽度的一半左右。

比较

对于纯文本,uniprint 具有更好的整体布局。另一方面,只有 wprint 能正确处理泰语输出。

5.2 使用固定尺寸字体打印

通常,使用固定尺寸字体打印无法获得像使用 TrueType 字体那样专业的输出效果。

txtbdf2ps

Serge Winitzki 的 txtbdf2ps 0.7 程序 http://members.linuxstart.com/~winitzki/txtbdf2ps.html 通过使用 BDF 字体将纯文本文件转换为 Postscript。 安装

# install -m 777 txtbdf2ps-dev.txt /usr/local/bin/txtbdf2ps
使用比例字体的示例
$ txtbdf2ps -BDF=cyberbit.bdf -UTF-8 -nowrap < input.txt > output.ps
使用固定宽度字体的示例
$ txtbdf2ps -BDF=unifont.bdf -UTF-8 -nowrap < input.txt > output.ps

注意:txtbdf2ps 不支持组合字符和双向文本 (bidi)。

5.3 经典方法

另一种使用 TrueType 字体打印的方法是使用 ttf2pt1 实用程序将 TrueType 字体转换为 Postscript 字体 (http://www.netspace.net.au/~mheath/ttf2pt1/, http://quadrant.netspace.net.au/ttf2pt1/, http://ttf2pt1.sourceforge.net/)。 详细信息可以在 Julius Chroboczek 的 “Printing with TrueType fonts in Unix” 文章中找到, http://www.dcs.ed.ac.uk/home/jec/programs/xfsft/printing.html

TeX, Omega

待办事项:CJK, metafont, omega, dvips, odvips, utf8-tex-0.1

DocBook

待办事项:db2ps, jadetex

groff -Tps

“groff -Tps” 生成 Postscript 输出。它的 Postscript 输出驱动程序仅支持非常有限数量的 Unicode 字符(仅限 Postscript 本身支持的字符)。

5.4 尝试失败...

Netscape 的 “打印...”

截至 4.72 版本,Netscape Communicator 无法正确打印 UTF-8 编码的 HTML 页面。你真的必须使用 wprint。

Mozilla 的 “打印...”

截至 M16 版本,HTML 页面的打印功能显然尚未实现。

html2ps

截至 1.0b1 版本,html2ps HTML 到 Postscript 转换器不支持 UTF-8 编码的 HTML 页面,并且没有对字体进行特殊处理:生成的 Postscript 使用标准的 Postscript 字体。

a2ps

截至 4.12 版本,a2ps 不支持打印 UTF-8 编码的文本。

enscript

截至 1.6.1 版本,enscript 不支持打印 UTF-8 编码的文本。默认情况下,它仅使用标准的 Postscript 字体,但它也可以在输出中包含自定义的 Postscript 字体。


下一页 上一页 目录