diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2007-05-07 02:37:43 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2007-05-07 02:37:43 +0000 |
commit | 7835017f887190c1827a2ae41b1e847722bacde1 (patch) | |
tree | a7e0a5a74480cbec26e2649427e4584f0bf6027b /pbmtext.html | |
parent | 60e3185d7f8c378da93205bc2916f3302114ef68 (diff) | |
download | netpbm-mirror-7835017f887190c1827a2ae41b1e847722bacde1.tar.gz netpbm-mirror-7835017f887190c1827a2ae41b1e847722bacde1.tar.xz netpbm-mirror-7835017f887190c1827a2ae41b1e847722bacde1.zip |
"miscellaneous update"
git-svn-id: http://svn.code.sf.net/p/netpbm/code/userguide@291 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'pbmtext.html')
-rw-r--r-- | pbmtext.html | 159 |
1 files changed, 104 insertions, 55 deletions
diff --git a/pbmtext.html b/pbmtext.html index a35690d5..0f47d6bf 100644 --- a/pbmtext.html +++ b/pbmtext.html @@ -2,17 +2,15 @@ <HTML><HEAD><TITLE>Pbmtext User Manual</TITLE></HEAD> <BODY> <H1>pbmtext</H1> -Updated: 14 April 2005 +Updated: 26 April 2007 <BR> <A HREF="#index">Table Of Contents</A> -<A NAME="lbAB"> </A> <H2>NAME</H2> pbmtext - render text into a PBM image -<A NAME="lbAC"> </A> -<H2>SYNOPSIS</H2> +<H2 id="synopsis">SYNOPSIS</H2> <B>pbmtext</B> [<B>-font</B> <I>fontfile</I>] @@ -28,8 +26,7 @@ hyphens instead of single hyphen to denote options. You may use white space in place of the equals sign to separate an option name from its value. -<A NAME="lbAD"> </A> -<H2>DESCRIPTION</H2> +<H2 id="description">DESCRIPTION</H2> <p>This program is part of <a href="index.html">Netpbm</a>. @@ -52,13 +49,17 @@ all the margins are half of this. You can use the <b>-nomargins</b> option to eliminate the margins. <p><b>pbmtextps</b> does the same thing as <b>pbmtext</b>, but uses -Ghostscript to generate the characters, which means it's a lot more -sophisticated and you can use Postscript fonts. But it also means you -have to have Ghostscript installed and it isn't as fast. +Ghostscript to generate the characters, which means you can use +Postscript fonts. But it also means you have to have Ghostscript +installed and it isn't as fast. Also, <b>pbmtextps</b> generates only +one line of text, whereas <b>pbmtext</b> can create multiple lines. +<p><b>pbmtext</b> is meant for small quantities of simple text. If you're +working with a <em>document</em>, you would be better off using a document +formatting program to "print" to a Postscript file, then +feeding that Postscript to <b>pstopnm</b>. -<A NAME="lbAE"> </A> -<H2>OPTIONS</H2> +<H2 id="options">OPTIONS</H2> <DL COMPACT> @@ -70,45 +71,19 @@ have to have Ghostscript installed and it isn't as fast. <b>-builtin</b> selects a font among those built into Netpbm. <b>-font</b> selects a font that you supply yourself either as an X -Window System BDF (Bitmap Distribution Format) file or as a PBM file -in a special form. +Window System <a href="http://xfree86.org/current/bdf.pdf">BDF (Bitmap +Distribution Format)</a> file or as a PBM file in a special form. <p>The default is the built in font "bdf." <p>"bdf" is Times-Roman 15 pixels high. (That's about 14 point type printed at 75 dpi). -<p>"fixed" is a built in fixed with font. +<p>"fixed" is a built in fixed width font. -<p>To create a font as a PBM file (to use with the <b>-font</b> -option), do this: In your window system of choice, display the -following text in the desired font (make sure it's a fixed width -font!): - -<PRE> - - M ",/^_[`jpqy| M - - / !"#$%&'()*+ / - < ,-./01234567 < - > 89:;<=>?@ABC > - @ DEFGHIJKLMNO @ - _ PQRSTUVWXYZ[ _ - { \]^_`abcdefg { - } hijklmnopqrs } - ~ tuvwxyz{|}~ ~ - - M ",/^_[`jpqy| M +<p>For information about other fonts, and how to make one of your own, +see <a href="#fonts">Fonts</a> below. -</PRE> - -Do a screen grab or window dump of that text, using for instance -<B>xwd</B>, <B>xgrabsc</B>, or <B>screendump</B>. Convert the result -into a pbm file. If necessary, use <B>pamcut</B> to remove anything -you grabbed in addition to the text pictured above (or be a wimp and -use a graphical editor such as ImageMagick). Finally, run it through -<B>pnmcrop</B>. to make sure the edges are right up against the text. -<B>pbmtext</B> can figure out the sizes and spacings from that. <DT><B>-space</B> <I>pixels</I> @@ -166,8 +141,7 @@ truncates each line as needed to fit the specified width. </DL> -<A NAME="lbAF"> </A> -<H2>USAGE</H2> +<H2 id="usage">USAGE</H2> <P>Often, you want to place text over another image. One way to do this is with <B>ppmlabel</B>. <B>ppmlabel</B> does not give you the @@ -189,8 +163,84 @@ black and white image for the alpha mask. <P>If you want the text at an angle, use <B>pnmrotate</B> on the text image (and alpha mask) before overlaying. -<A NAME="lbAG"> </A> -<H2>SEE ALSO</H2> +<h2 id="#font">FONTS</h2> + +<p>There are three kinds of fonts you an use with <b>pbmtext</b>: + +<ul> +<li>built in +<li>BDF +<li>PBM +</ul> + +<h3>BDF Font</h3> + +<p>BDF is an ancient font format that at one time was standard for the +X Window System. Now, you don't see it very often, but you can find +some BDF fonts on the <a +href="http://cvsweb.xfree86.org/cvsweb/xc/fonts/bdf/">Xfree86</a> +web site. + +<p>You can get the full package of the BDF fonts from XFree86 (see above) +from the <a href="netpbm.sourceforge.net/bdffont.tgz">Netpbm web site</a>. + +<h3>PBM Font</h3> + +<p>To create a font as a PBM file (to use with the <b>-font</b> +option), you just create a PBM image of the text matrix below. + +<p>The first step is to display text matrix below on the screen, +e.g. in an X11 window. + +<PRE> + + M ",/^_[`jpqy| M + + / !"#$%&'()*+ / + < ,-./01234567 < + > 89:;<=>?@ABC > + @ DEFGHIJKLMNO @ + _ PQRSTUVWXYZ[ _ + { \]^_`abcdefg { + } hijklmnopqrs } + ~ tuvwxyz{|}~ ~ + + M ",/^_[`jpqy| M + +</PRE> + +<p>Make sure it's a fixed width font -- This should display as a +perfect rectangle. + +<p>Also, try to use a simple display program. Pbmtext divides this +into a matrix of cells, all the same size, each containing one +character, so it is important that whatever you use to display it +display with uniform horizontal and vertical spacing. Fancy word +processing programs sometimes stretch characters in both directions to +fit certain dimensions, and that won't work. Sometimes a display +program scales a font to show a character larger or smaller than its +natural size. That too won't often work because the rounding involved +in such scaling causes non-uniform distances between characters. + +<p>If you display the text matrix improperly, the usual symptom is +that when you try to use the font, <b>pbmtext</b> fails with an error +message telling you that the number of lines in the font isn't +divisible by 11, or it can't find the blank band around the inner +rectangle. Sometimes the symptom is that one of the characters +displays with a piece of the character that is next to it in the +matrix. For example, "l" might display with a little piece +of the "m" attached on its right. + +<p>Do a screen grab or window dump of that text, using for instance +<B>xwd</B>, <B>xgrabsc</B>, or <B>screendump</B>. Convert the result +into a pbm file. If necessary, use <B>pamcut</B> to remove anything +you grabbed in addition to the text pictured above (or be a wimp and +use a graphical editor such as ImageMagick). Finally, run it through +<B>pnmcrop</B>. to make sure the edges are right up against the text. +<B>pbmtext</B> can figure out the sizes and spacings from that. + + +<H2 id="seealso">SEE ALSO</H2> <B><A HREF="pbmtextps.html">pbmtextps</A></B>, <B><A HREF="pamcut.html">pamcut</A></B>, @@ -202,8 +252,7 @@ image (and alpha mask) before overlaying. <B><A HREF="pstopnm.html">pstopnm</A></B>, <B><A HREF="pbm.html">pbm</A></B> -<A NAME="lbAH"> </A> -<H2>AUTHOR</H2> +<H2 id="author">AUTHOR</H2> Copyright (C) 1993 by Jef Poskanzer and George Phillips @@ -211,13 +260,13 @@ Copyright (C) 1993 by Jef Poskanzer and George Phillips <A NAME="index"> </A> <H2>Table Of Contents</H2> <UL> -<LI><A HREF="#lbAB">NAME</A> -<LI><A HREF="#lbAC">SYNOPSIS</A> -<LI><A HREF="#lbAD">DESCRIPTION</A> -<LI><A HREF="#lbAE">OPTIONS</A> -<LI><A HREF="#lbAF">USAGE</A> -<LI><A HREF="#lbAG">SEE ALSO</A> -<LI><A HREF="#lbAH">AUTHOR</A> +<LI><A HREF="#synopsis">SYNOPSIS</A> +<LI><A HREF="#description">DESCRIPTION</A> +<LI><A HREF="#options">OPTIONS</A> +<LI><A HREF="#usage">USAGE</A> +<LI><A HREF="#fonts">FONTS</A> +<LI><A HREF="#seealso">SEE ALSO</A> +<LI><A HREF="#author">AUTHOR</A> </UL> </BODY> </HTML> |