1Pbmtextps User Manual(0) Pbmtextps User Manual(0)
2
3
4
6 pbmtextps - render text into a PBM image using a postscript interpreter
7
8
10 pbmtextps [-font fontname] [-fontsize float] [-resolution n] [-leftmar‐
11 gin=n] [-rightmargin=n] [-topmargin=n] [-bottommargin=n] [-ascent=n]
12 [-descent=n] [-pad] [-crop] [-stroke n] [-verbose] [-dump-ps] text
13
14
16 This program is part of Netpbm(1).
17
18 pbmtextps takes a single line of text from the command line and renders
19 it into a PBM image. The image is of a single line of text; newline
20 characters in the input have no effect.
21
22 See pbmtext for a more sophisticated generator of text, but using less
23 common font formats. pbmtext can generate multiple lines of text.
24
25 The -plain common option ⟨index.html#commonoptions⟩ has no effect be‐
26 fore Netpbm 10.42 (March 2008). The output is always raw PBM.
27
28
29 Margins
30 By default, the image is cropped at the top and the right. It is not
31 cropped at the left or bottom so that the text begins at the same posi‐
32 tion relative to the origin. The size of the default left and bottom
33 margins is explained below.
34
35 You can set whatever margin you want with options -leftmargin, -right‐
36 margin, -topmargin and -bottommargin. The specified amount of white
37 space gets added to the far edge of type, e.g. if you specify 10 points
38 for -topmargin, you will get 10 points of white space above the highest
39 character on the line. Specify 0 to crop a side.
40
41 -ascent adds white space to the top to reach a specified distance above
42 the text baseline, and -descent adds white space to to the bottom to
43 reach a specified distance below the text baseline.
44
45 -ascent and -descent are more useful than -topmargin and -bottomargin
46 when you render two pieces of text (in separate invocations of pbm‐
47 textps) that you will concatenate horizontally. With -ascent and -de‐
48 scent, as long as you specify a value greater than the height or detph
49 of every character in the font, the two images will be the same height
50 with the text baseline in the same place. With -topmargin and -bottom‐
51 margin, that may not be the case.
52
53 Example:
54
55 $ pbmtextps -font=Times-Roman -descent=20 \
56 'The soup is called' > a1.pbm
57 $ pbmtextps -font=Itallic -descent=20 'Goulash.' > a2.pbm
58 $ pnmcat -leftright -jbottom a1.pbm a2.pbm > out.pbm
59
60
61 If you're using -descent to line up the segments of text you are
62 concatenating horizontally with pnmcat, use the -jbottom
63 (justify to bottom) option on pnmcat as in the example above. If you
64 use -ascent, use -jtop instead.
65
66 Similarly, if you render two lines of text (in separate invocations of
67 pbmtextps) that you will concatenate vertically, -ascent and
68 -descent with sufficiently large values will ensure your baselines
69 are uniformly spaced.
70
71 If you have -ascent, there is probably no point in specifying -topmar‐
72 gin too, but if you do, the effect is cumulative. The same is true of
73 -descent and -bottommargin.
74
75 -pad pads the image on the top and bottom to the where the highest and
76 lowest characters in the font would reach, even if you don't have those
77 characters in your text. This is useful if you will generate multiple
78 images of text (with multiple invocations of pbmtextps) and concatenate
79 them vertically to create a multiline text image. -pad makes sure the
80 lines in this image are equally spaced.
81
82 Example:
83
84 $ pbmtextps 'cat' | pamfile
85 $ pbmtextps 'Catty' | pamfile
86
87
88 The commands above, with no -pad, show that the 'Catty' image is higher
89 because capital C reaches high and 'y' reaches low.
90
91 $ pbmtextps -pad 'cat' | pamfile
92 $ pbmtextps -pad 'Catty' | pamfile
93
94
95 The commands above, with -pad, show that both images are the same
96 height.
97
98 If you specify -pad with -ascent or -descent, the larger value is ef‐
99 fective.
100
101 -crop makes the program crop all sides to the far edge of the type. It
102 is the same as -leftmargin=0 -rightmargin=0 -topmargin=0 -bottommar‐
103 gin=0.
104
105 You cannot specify any other margin-affecting options with -crop.
106
107 The default top margin, when you specify neither -ascent, -topmargin,
108 nor -pad, is as if you specified topmargin=0.
109
110 The default bottom margin, when you specify neither -descent, -bottom‐
111 margin, nor -pad, is as if you specified -descent=1.5*fontsize.
112
113 The default left margin, when you do not specify -leftmargin, is as if
114 you specified -leftmargin=0.5*fontsize.
115
116 The default right margin, when you do not specify -rightmargin, is as
117 if you specified -rightmargin=0.
118
119
120
122 In addition to the options common to all programs based on libnetpbm
123 (most notably -quiet, see
124 Common Options ⟨index.html#commonoptions⟩ ), pbmtextps recognizes the
125 following command line options:
126
127
128
129 -font=fontname
130
131 This specifies the font to use. fontname is the name of any
132 valid postscript font which is installed on the system.
133
134 The default is TimesRoman.
135
136 Warning: if fontname does not name a valid font, pbmtextps just
137 uses the default font. It does not tell you it is doing this.
138
139
140 -fontsize=float
141 This is the size of the font in points. See the -resolution op‐
142 tion for information on how to interpret this size.
143
144 The default is 24 points.
145
146 Before Netpbm 10.75 (June 2016), this has to be a whole number.
147
148
149 -resolution=n
150 This is the resolution in dots per inch of distance measurements
151 pertaining to generation of the image. PBM images don't have
152 any inherent resolution, so a distance such as "1 inch" doesn't
153 mean anything unless you separately specify what resolution
154 you're talking about. That's what this option does.
155
156 In particular, the meaning of the font size is determined by
157 this resolution. If the font size is 24 points and the resolu‐
158 tion is 150 dpi, then the font size is 50 pixels.
159
160 The default is 150 dpi.
161
162
163 -leftmargin=n
164
165 -rightmargin=n
166
167 -topmargin=n
168
169 -bottommargin=n
170 These options control the margins added to the image, measured
171 from the far edge of the type. See Margins ⟨#margins⟩ for de‐
172 tails.
173
174 All sizes are in points, as a floating point number.
175
176 These options were new in Netpbm 10.75 (June 2016).
177
178
179 -ascent=n
180
181 -descent=n
182 These options control the margins added to the image, measured
183 from the text baseline. See Margins ⟨#margins⟩ for details.
184
185 Sizes are in points, as a floating point number.
186
187 These options were new in Netpbm 10.75 (June 2016).
188
189
190 -pad This pads the image on the top and bottom to the where the high‐
191 est and lowest characters in the font would reach, even if you
192 don't have those characters in your text. See Margins
193 ⟨#margins⟩ for details.
194
195 This option was new in Netpbm 10.75 (June 2016).
196
197
198 -crop This makes the program crop all sides to the far edge of the
199 type. It is the same as -leftmargin=0 -rightmargin=0 -topmar‐
200 gin=0 -bottommargin=0. See Margins ⟨#margins⟩ for details.
201
202 This option was new in Netpbm 10.75 (June 2016).
203
204
205 -stroke=n
206 This is the width of line, in points, to use for stroke font.
207 There is no default stroke width because the characters are
208 solid by default.
209
210
211 -verbose
212 This option makes pbmtextps display extra information on Stan‐
213 dard Error about its processing.
214
215
216 -dump-ps
217 This option makes pbmtextps write to Standard Output the Post‐
218 script program it would use to create the image, rather than the
219 image itself. You can use this as input to a Postscript inter‐
220 preter (such as Ghostscript or a a printer) or to understand the
221 program better.
222
223 This option was new in Netpbm 10.75 (June 2016).
224
225
226
227
229 You can generate antialiased text by using a larger resolution than the
230 default and scaling the image down using pamscale.
231
232 See the manual for the similar pbmtext for more advice on usage.
233
234
236 pbmtextps was added to Netpbm in Release 10.0 (June 2002).
237
238
239
241 pbmtext(1), pamcut(1), pnmcrop(1), pamcomp(1), ppmchange(1), pnmro‐
242 tate(1), pamscale(1), ppmlabel(1), pbm(1)
243
244
246 Copyright (C) 2002 by James McCann
247
249 This manual page was generated by the Netpbm tool 'makeman' from HTML
250 source. The master documentation is at
251
252 http://netpbm.sourceforge.net/doc/pbmtextps.html
253
254netpbm documentation 04 June 2022 Pbmtextps User Manual(0)