old-www/HOWTO/Unicode-HOWTO-5.html

164 lines
4.9 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
<TITLE>The Unicode HOWTO: Printing</TITLE>
<LINK HREF="Unicode-HOWTO-6.html" REL=next>
<LINK HREF="Unicode-HOWTO-4.html" REL=previous>
<LINK HREF="Unicode-HOWTO.html#toc5" REL=contents>
</HEAD>
<BODY>
<A HREF="Unicode-HOWTO-6.html">Next</A>
<A HREF="Unicode-HOWTO-4.html">Previous</A>
<A HREF="Unicode-HOWTO.html#toc5">Contents</A>
<HR>
<H2><A NAME="s5">5. Printing</A></H2>
<P>
<P>Since Postscript itself does not support Unicode fonts, the burden of
Unicode support in printing is on the program creating the Postscript
document, not on the Postscript renderer.
<P>The existing Postscript fonts I've seen - .pfa/.pfb/.afm/.pfm/.gsf -
support only a small range of glyphs and are not Unicode fonts.
<P>
<P>
<P>
<H2><A NAME="ss5.1">5.1 Printing using TrueType fonts</A>
</H2>
<P>
<P>Both the uniprint and wprint programs produce good printed output
for Unicode plain text. They require a TrueType font; see section
"TrueType fonts" above. The Bitstream Cyberbit gives good results.
<P>
<H3>uniprint</H3>
<P>
<P>The "uniprint" program contained in the yudit package can convert a text
file to Postscript. For uniprint to find the Cyberbit font, symlink it to
<CODE>/usr/local/share/yudit/data/cyberbit.ttf</CODE>.
<P>
<H3>wprint</H3>
<P>
<P>The "wprint" (WorldPrint) program by Eduardo Trapani
<A HREF="http://ttt.esperanto.org.uy/programoj/angle/wprint.html">http://ttt.esperanto.org.uy/programoj/angle/wprint.html</A>
postprocesses Postscript output produced by Netscape Communicator or Mozilla
from HTML pages or plain text files.
<P>The output is nearly perfect; only in Cyrillic paragraphs the line breaking
is incorrect: the lines are only about half as wide as they should be.
<P>
<H3>Comparison</H3>
<P>
<P>For plain text, uniprint has a better overall layout. On the other hand,
only wprint gets Thai output correct.
<P>
<H2><A NAME="ss5.2">5.2 Printing using fixed-size fonts</A>
</H2>
<P>
<P>Generally, printing using fixed-size fonts does not give an as professional
output as using TrueType fonts.
<P>
<H3>txtbdf2ps</H3>
<P>
<P>The txtbdf2ps 0.7 program by Serge Winitzki
<A HREF="http://members.linuxstart.com/~winitzki/txtbdf2ps.html">http://members.linuxstart.com/~winitzki/txtbdf2ps.html</A>
converts a plain text file to Postscript, by use of a BDF font.
Installation:
<BLOCKQUOTE><CODE>
<PRE>
# install -m 777 txtbdf2ps-dev.txt /usr/local/bin/txtbdf2ps
</PRE>
</CODE></BLOCKQUOTE>
Example with a proportional font:
<BLOCKQUOTE><CODE>
<PRE>
$ txtbdf2ps -BDF=cyberbit.bdf -UTF-8 -nowrap &lt; input.txt > output.ps
</PRE>
</CODE></BLOCKQUOTE>
Example with a fixed-width font:
<BLOCKQUOTE><CODE>
<PRE>
$ txtbdf2ps -BDF=unifont.bdf -UTF-8 -nowrap &lt; input.txt > output.ps
</PRE>
</CODE></BLOCKQUOTE>
<P>Note: txtbdf2ps does not support combining characters and bidi.
<P>
<H2><A NAME="ss5.3">5.3 The classical approach</A>
</H2>
<P>
<P>Another way to print with TrueType fonts is to convert the TrueType font to
a Postscript font using the <CODE>ttf2pt1</CODE> utility
(
<A HREF="http://www.netspace.net.au/~mheath/ttf2pt1/">http://www.netspace.net.au/~mheath/ttf2pt1/</A>,
<A HREF="http://quadrant.netspace.net.au/ttf2pt1/">http://quadrant.netspace.net.au/ttf2pt1/</A>,
<A HREF="http://ttf2pt1.sourceforge.net/">http://ttf2pt1.sourceforge.net/</A>). Details can be
found in Julius Chroboczek's "Printing with TrueType fonts in Unix" writeup,
<A HREF="http://www.dcs.ed.ac.uk/home/jec/programs/xfsft/printing.html">http://www.dcs.ed.ac.uk/home/jec/programs/xfsft/printing.html</A>.
<P>
<H3>TeX, Omega</H3>
<P>
<P>TODO: CJK, metafont, omega, dvips, odvips, utf8-tex-0.1
<P>
<P>
<H3>DocBook</H3>
<P>
<P>TODO: db2ps, jadetex
<P>
<H3>groff -Tps</H3>
<P>
<P>"groff -Tps" produces Postscript output. Its Postscript output driver
supports only a very limited number of Unicode characters (only what
Postscript supports by itself).
<P>
<P>
<H2><A NAME="ss5.4">5.4 No luck with...</A>
</H2>
<H3>Netscape's "Print..."</H3>
<P>
<P>As of version 4.72, Netscape Communicator cannot correctly print HTML
pages in UTF-8 encoding. You really have to use wprint.
<P>
<H3>Mozilla's "Print..."</H3>
<P>
<P>As of version M16, printing of HTML pages is apparently not implemented.
<P>
<H3>html2ps</H3>
<P>
<P>As of version 1.0b1, the html2ps HTML to Postscript converter does not support
UTF-8 encoded HTML pages and has no special treatment of fonts: the generated
Postscript uses the standard Postscript fonts.
<P>
<H3>a2ps</H3>
<P>
<P>As of version 4.12, a2ps doesn't support printing UTF-8 encoded text.
<P>
<H3>enscript</H3>
<P>
<P>As of version 1.6.1, enscript doesn't support printing UTF-8 encoded text.
By default, it uses only the standard Postscript fonts, but it can also
include a custom Postscript font in the output.
<P>
<P>
<HR>
<A HREF="Unicode-HOWTO-6.html">Next</A>
<A HREF="Unicode-HOWTO-4.html">Previous</A>
<A HREF="Unicode-HOWTO.html#toc5">Contents</A>
</BODY>
</HTML>