summaryrefslogtreecommitdiffstats
path: root/upstream/fedora-40/man1/pbmtextps.1
blob: 109eb6e999c7bbf56c8b9b02c2613caa670ae041 (plain)
1
2
3
4
5
6
7
8
9
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
\
.\" This man page was generated by the Netpbm tool 'makeman' from HTML source.
.\" Do not hand-hack it!  If you have bug fixes or improvements, please find
.\" the corresponding HTML page on the Netpbm website, generate a patch
.\" against that, and send it to the Netpbm maintainer.
.TH "Pbmtextps User Manual" 0 "17 February 2023" "netpbm documentation"

.SH NAME
pbmtextps - render text into a PBM image using a postscript interpreter

.UN synopsis
.SH SYNOPSIS

\fBpbmtextps\fP
[\fB-font\fP \fIfontname\fP]
[\fB-fontsize\fP \fIfloat\fP]
[\fB-resolution\fP \fIn\fP]
[\fB-leftmargin=\fP\fIn\fP]
[\fB-rightmargin=\fP\fIn\fP]
[\fB-topmargin=\fP\fIn\fP]
[\fB-bottommargin=\fP\fIn\fP]
[\fB-ascent=\fP\fIn\fP]
[\fB-descent=\fP\fIn\fP]
[\fB-pad\fP]
[\fB-crop\fP]
[\fB-stroke\fP \fIn\fP]
[\fB-asciihex\fP]
[\fB-ascii85\fP]
[\fB-verbose\fP]
[\fB-dump-ps\fP]
\fItext\fP [\fItext\fP ...]

.UN description
.SH DESCRIPTION
.PP
This program is part of
.BR "Netpbm" (1)\c
\&.
.PP
\fBpbmtextps\fP takes a single line of text from the command line and
renders it into a PBM image.  The image is of a single line of text; newline
characters in the input have no effect.
.PP
See \fBpbmtext\fP for a more sophisticated generator of text, but using
less common font formats.  \fBpbmtext\fP can generate multiple lines of text.
.PP
The \fB-plain\fP 
.UR index.html#commonoptions
common option
.UE
\& has
no effect before Netpbm 10.42 (March 2008).  The output is always raw PBM.

.UN margins
.SS Margins
.PP
By default, the image is cropped at the top and the right.  It is not
cropped at the left or bottom so that the text begins at the same position
relative to the origin.  The size of the default left and bottom margins is
explained below.
.PP
You can set whatever margin you want with options
\fB-leftmargin\fP, \fB-rightmargin\fP, \fB-topmargin\fP and
\fB-bottommargin\fP.  The specified amount of white space gets added to the
far edge of type, e.g. if you specify 10 points for \fB-topmargin\fP, you
will get 10 points of white space above the highest character on the line.
Specify 0 to crop a side.
.PP
\fB-ascent\fP adds white space to the top to reach a specified distance
above the text baseline, and \fB-descent\fP adds white space to to the bottom
to reach a specified distance below the text baseline.
.PP
\fB-ascent\fP and \fB-descent\fP are more useful than \fB-topmargin\fP
and \fB-bottomargin\fP when you render two pieces of text (in separate
invocations of \fBpbmtextps\fP) that you will concatenate horizontally.
With \fB-ascent\fP and \fB-descent\fP, as long as you specify a value
greater than the height or detph of every character in the font, the two
images will be the same height with the text baseline in the same place.
With \fB-topmargin\fP and \fB-bottommargin\fP, that may not be the case.
.PP
Example:

.nf
\f(CW
     $ pbmtextps -font=Times-Roman -descent=20 \e
          'The soup is called' > a1.pbm
     $ pbmtextps -font=Itallic -descent=20 'Goulash.' > a2.pbm
     $ pnmcat -leftright -jbottom a1.pbm a2.pbm > out.pbm
\fP

.fi
.PP
If you're using \fB-descent\fP to line up the segments of text you are
  concatenating horizontally with \fBpnmcat\fP, use the \fB-jbottom\fP
  (justify to bottom) option on \fBpnmcat\fP as in the example above.  If you
  use \fB-ascent\fP, use \fB-jtop\fP instead.
.PP
Similarly, if you render two lines of text (in separate invocations of
  \fBpbmtextps\fP) that you will concatenate vertically, \fB-ascent\fP and
  \fB-descent\fP with sufficiently large values will ensure your baselines
  are uniformly spaced.
.PP
If you have \fB-ascent\fP, there is probably no point in specifying
\fB-topmargin\fP too, but if you do, the effect is cumulative.  The same is
true of \fB-descent\fP and \fB-bottommargin\fP.
.PP
\fB-pad\fP pads the image on the top and bottom to the where the highest
and lowest characters in the font would reach, even if you don't have those
characters in your text.  This is useful if you will generate multiple images
of text (with multiple invocations of \fBpbmtextps\fP) and concatenate them
vertically to create a multiline text image.  \fB-pad\fP makes sure the lines
in this image are equally spaced.
.PP
Example:

.nf
\f(CW
    $ pbmtextps 'cat'   | pamfile
    $ pbmtextps 'Catty' | pamfile
\fP

.fi
.PP
The commands above, with no \fB-pad\fP, show that the 'Catty'
image is higher because capital C reaches high and 'y' reaches low.

.nf
\f(CW
    $ pbmtextps -pad 'cat'   | pamfile
    $ pbmtextps -pad 'Catty' | pamfile
\fP

.fi
.PP
The commands above, with \fB-pad\fP, show that both images are the same
height.
.PP
If you specify \fB-pad\fP with \fB-ascent\fP or \fB-descent\fP, the
larger value is effective.
.PP
\fB-crop\fP makes the program crop all sides to the far edge of the type.
It is the same as \f(CW-leftmargin=0 -rightmargin=0 -topmargin=0
-bottommargin=0\fP.
.PP
You cannot specify any other margin-affecting options with \fB-crop\fP.
.PP
The default top margin, when you specify neither \fB-ascent\fP,
\fB-topmargin\fP, nor \fB-pad\fP, is as if you specified
\fBtopmargin=0\fP.
.PP
The default bottom margin, when you specify neither \fB-descent\fP,
\fB-bottommargin\fP, nor \fB-pad\fP, is as if you specified
\fB-descent=\fP\fI1.5*fontsize\fP.
.PP
The default left margin, when you do not specify \fB-leftmargin\fP, is
as if you specified \fB-leftmargin=\fP\fI0.5*fontsize\fP.
.PP
The default right margin, when you do not specify \fB-rightmargin\fP,
is as if you specified \fB-rightmargin=0\fP.


<h3 id="input_text">Input Text</h2>
.PP
The simplest way to specify the text to render is just to specify it,
  in ASCII, as the sole argument of the command.  For example,

.nf
    \f(CW
  $ pbmtextps 'hello world'
    \fP

.fi
.PP
But you can also spread it across multiple arguments.  \fBpbmtextps\fP
  concatenates them right to left with a single space in between:
  
.nf
    \f(CW
  $ pbmtextps hello world
    \fP

.fi
.PP
With an \fB-asciihex\fP option, you can specify the text in
Postscript&apos;s ASCII-HEX code:
  
.nf
    \f(CW
  $ pbmtextps -asciihex 68656c6c6f20776f726c64
    \fP

.fi
.PP
You can optionally include the ASCII-HEX text delimiters that would appear
around the text in a Postscript program:

.nf
    \f(CW
  $ pbmtextps -asciihex '<68656c6c6f20776f726c64>'
    \fP

.fi
.PP
Note that the <> delimiters have special meaning to command shells, so if
you are invoking \fBpbmtextps\fP via a command shell, be sure to quote them,
as is done in this example.
  
.PP
With \fB-asciihex\fP, you can include white space anywhere in the coded
text; it has no effect.  And you can spread the argument across multiple
arguments as for plain ASCII input:

.nf
    \f(CW
  $ pbmtextps -asciihex '<' 68656c6c6f 20 776f726c64 '>'
    \fP

.fi
.PP
But note that while Postscript allows an ASCII NUL character as white
  space, there is no way to pass an argument including a NUL character to
  \fBpbmtextps\fP.
  
.PP
With an \fB-ascii85\fP option, you can specify the text in
Postscript&apos;s ASCII-85 code.  This is analogous to \fB-asciihex\fP.  The
Postscript delimiters for an ASCII-85 text string are <~ ~>.

  
.UN options
.SH OPTIONS
.PP
In addition to the options common to all programs based on libnetpbm
(most notably \fB-quiet\fP, see 
.UR index.html#commonoptions
 Common Options
.UE
\&), \fBpbmtextps\fP recognizes the following
command line options:


.TP
\fB-font=\fP\fIfontname\fP
.sp
This specifies the font to use.  \fIfontname\fP is the name of any valid
Postscript font which is installed on the system.
.sp
The default is \fBTimesRoman\fP.
.sp
Here is a way to get a list of the names of all the available fonts:

.nf
\f(CW
        $ gs -c &apos;(*) {==} 256 string /Font resourceforall&apos;
\fP

.fi
.sp
\fBWarning:\fP if \fIfontname\fP does not name a valid font,
\fBpbmtextps\fP just uses the default font.  It does not tell you it is doing
this.

.TP
\fB-fontsize=\fP\fIfloat\fP
This is the size of the font in points.  See the \fB-resolution\fP option for
information on how to interpret this size.
.sp
The default is 24 points.
.sp
Before Netpbm 10.75 (June 2016), this has to be a whole number.

.TP
\fB-resolution=\fP\fIn\fP
This is the resolution in dots per inch of distance measurements pertaining to
generation of the image.  PBM images don't have any inherent resolution, so a
distance such as "1 inch" doesn't mean anything unless you separately specify
what resolution you're talking about.  That's what this option does.
.sp
In particular, the meaning of the font size is determined by this
resolution.  If the font size is 24 points and the resolution is 150 dpi, then
the font size is 50 pixels.
.sp
The default is 150 dpi.

.TP
\fB-leftmargin=\fP\fIn\fP
.TP
\fB-rightmargin=\fP\fIn\fP
.TP
\fB-topmargin=\fP\fIn\fP
.TP
\fB-bottommargin=\fP\fIn\fP
These options control the margins added to the image, measured from the far
edge of the type.  See 
.UR #margins
Margins
.UE
\& for details.
.sp
All sizes are in points, as a floating point number.
.sp
These options were new in Netpbm 10.75 (June 2016).

.TP
\fB-ascent=\fP\fIn\fP
.TP
\fB-descent=\fP\fIn\fP
These options control the margins added to the image, measured from
the text baseline.  See 
.UR #margins
Margins
.UE
\& for details.
.sp
Sizes are in points, as a floating point number.
.sp
These options were new in Netpbm 10.75 (June 2016).

.TP
\fB-pad\fP
This pads the image on the top and bottom to the where the highest and lowest
characters in the font would reach, even if you don't have those characters in
your text.  See 
.UR #margins
Margins
.UE
\& for details.
.sp
This option was new in Netpbm 10.75 (June 2016).

.TP
\fB-crop\fP
This makes the program crop all sides to the far edge of the type.  It is the
same as \f(CW-leftmargin=0 -rightmargin=0 -topmargin=0 -bottommargin=0\fP.
See 
.UR #margins
Margins
.UE
\& for details.
.sp
This option was new in Netpbm 10.75 (June 2016).

.TP
\fB-asciihex\fP
This means the text in the arguments is in Postscript ASCII-HEX code.
See 
.UR #input_text
Input Text
.UE
\&.
.sp
You cannot specify this together with \fB-ascii85\fP.
.sp
This option was new in Netpbm 11.02 (March 2023)

.TP
\fB-ascii85\fP
This means the text in the arguments is in Postscript ASCII-85 code.
See 
.UR #input_text
Input Text
.UE
\&.
.sp
You cannot specify this together with \fB-asciihex\fP.
.sp
This option was new in Netpbm 11.02 (March 2023)
  
.TP
\fB-stroke=\fP\fIn\fP
This is the width of line, in points, to use for stroke font.  There is no
default stroke width because the characters are solid by default.

.TP
\fB-verbose\fP
This option makes \fBpbmtextps\fP display extra information on Standard Error
about its processing.

.TP
\fB-dump-ps\fP
This option makes \fBpbmtextps\fP write to Standard Output the Postscript
program it would use to create the image, rather than the image itself.  You
can use this as input to a Postscript interpreter (such as Ghostscript or a
printer) or to understand the program better.
.sp
This option was new in Netpbm 10.75 (June 2016).



.UN usage
.SH USAGE

You can generate antialiased text by using a larger resolution than the
default and scaling the image down using \fBpamscale\fP.
.PP
See the manual for the similar \fBpbmtext\fP for more advice on
usage.

.UN history
.SH HISTORY
.PP
\fBpbmtextps\fP was added to Netpbm in Release 10.0 (June 2002).


.UN seealso
.SH SEE ALSO
.BR "pbmtext" (1)\c
\&,
.BR "pamcut" (1)\c
\&,
.BR "pnmcrop" (1)\c
\&,
.BR "pamcomp" (1)\c
\&,
.BR "ppmchange" (1)\c
\&,
.BR "pnmrotate" (1)\c
\&,
.BR "pamscale" (1)\c
\&,
.BR "ppmlabel" (1)\c
\&,
.BR "pbm" (1)\c
\&

.UN author
.SH AUTHOR

Copyright (C) 2002 by James McCann
.SH DOCUMENT SOURCE
This manual page was generated by the Netpbm tool 'makeman' from HTML
source.  The master documentation is at
.IP
.B http://netpbm.sourceforge.net/doc/pbmtextps.html
.PP