man-pages/man1/pbmtext.1.html
2021-03-31 01:06:50 +01:00

257 lines
5.7 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of pbmtext</TITLE>
</HEAD><BODY>
<H1>pbmtext</H1>
Section: User Commands (1)<BR>Updated: 28 January 2001<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="ixAAB"></A>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
pbmtext - render text into a bitmap
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>pbmtext</B>
[<B>-font</B>
<I>fontfile</I>]
[<B>-builtin</B>
<I>fontname</I>]
[<B>-space</B>
<I>pixels</I>]
[<B>-lspace</B>
<I>pixels</I>]
[<I>text</I>]
<P>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<P>
Takes the specified text, either a single line from the command line
or multiple lines from standard input, and renders it into a bitmap.
<P>
In the bitmap, each line of input is a line of output. Formatting
characters such as newline have no effect on the formatting; like any
unprintable character, they turn into spaces.
<P>
The bitmap is just wide enough for the longest line of text, plus
margins, and just high enough to contain the lines of text, plus
margins. The left and right margins are twice the width of the widest
character in the font; the top and bottom margins are the height of
the tallest character in the font. But if the text is only one line,
all the margins are half of this.
<P>
<A NAME="ixAAC"></A>
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
<DL COMPACT>
<DT id="1"><B>-font</B>,<B>-builtin</B>
<DD>
By default, pbmtext uses a built-in font called bdf (about a 10 point
Times-Roman font). You can use a fixed width font by specifying
<B>-builtin fixed</B>.
<P>
You can also specify your own font with the
<B>-font</B>
flag.
The
<I>fontfile</I>
is either a BDF file from the X window system or a PBM file.
<P>
If the
<I>fontfile</I>
is a PBM file, it is created in a very specific way. In your window
system of choice, display the following text in the desired
(fixed-width) font:
<PRE>
M &quot;,/^_[`jpqy| M
/ !&quot;#$%&amp;'()*+ /
&lt; ,-./01234567 &lt;
&gt; 89:;&lt;=&gt;?@ABC &gt;
@ DEFGHIJKLMNO @
_ PQRSTUVWXYZ[ _
{ \]^_`abcdefg {
} hijklmnopqrs }
~ tuvwxyz{|}~ ~
M &quot;,/^_[`jpqy| M
</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>pnmcut</B>
to remove everything except the text. Finally, run it through
<B>pnmcrop</B>
<A NAME="ixAAD"></A>
to make sure the edges are right up against the text.
<B>pbmtext</B>
can figure out the sizes and spacings from that.
<P>
<DT id="2"><B>-space </B><I>pixels</I>
<DD>
Add
<I>pixels</I>
pixels of space between characters. This is in addition to whatever
space surrounding characters is built into the font, which is usually
enough to produce a reasonable string of text.
<P>
<I>pixels</I>
may be negative to crowd text together, but the author has not put much
thought or testing into how this works in every possible case, so it might
cause disastrous results.
<P>
<DT id="3">-B -lspace <I>pixels<DD>
Add
pixels</I>
pixels of space between lines. This is in addition to whatever space above
and below characters is built into the font, which is usually enough to
produce a reasonable line spacing.
<P>
<I>pixels</I>
must be a whole number.
<P>
<I>pixels</I>
may be negative to crowd lines together, but the author has not put much
thought or testing into how this works in every possible case, so it might
cause disastrous results.
<P>
<P>
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>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 font options that
<B>pbmtext </B>
does, though.
<P>
Another way is to use
<B>pbmtext</B>
to create an image containing the text, then use
<B>pnmcomp</B>
to overlay the text image onto your base image. To make only the text
(and not the entire rectangle containing it) cover the base image, you
will need to give
<B>pnmcomp</B>
a mask, via its
<B>-alpha</B>
option. You can just use the text image itself as the mask, as long as
you also specify the
<B>-invert</B>
option to
<B>pnmcomp</B>.
<P>
If you want to overlay colored text instead of black, just use
<B>ppmchange</B>
to change all black pixels to the color of your choice before
overlaying the text image. But still use the original 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.
<P>
<A NAME="lbAG">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?1+pnmcut">pnmcut</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+pnmcrop">pnmcrop</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+pnmcomp">pnmcomp</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+ppmchange">ppmchange</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+pnmrotate">pnmrotate</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+pbmtextps">pbmtextps</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+ppmlabel">ppmlabel</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?5+pbm">pbm</A></B>(5)
<P>
<A NAME="lbAH">&nbsp;</A>
<H2>AUTHOR</H2>
Copyright (C) 1993 by Jef Poskanzer and George Phillips
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="4"><A HREF="#lbAB">NAME</A><DD>
<DT id="5"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="6"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="7"><A HREF="#lbAE">OPTIONS</A><DD>
<DT id="8"><A HREF="#lbAF">USAGE</A><DD>
<DT id="9"><A HREF="#lbAG">SEE ALSO</A><DD>
<DT id="10"><A HREF="#lbAH">AUTHOR</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:21 GMT, March 31, 2021
</BODY>
</HTML>