groff_font.man revision 75584
1.ig \"-*- nroff -*-
2Copyright (C) 1989-1995, 2001 Free Software Foundation, Inc.
3
4Permission is granted to make and distribute verbatim copies of
5this manual provided the copyright notice and this permission notice
6are preserved on all copies.
7
8Permission is granted to copy and distribute modified versions of this
9manual under the conditions for verbatim copying, provided that the
10entire resulting derived work is distributed under the terms of a
11permission notice identical to this one.
12
13Permission is granted to copy and distribute translations of this
14manual into another language, under the above conditions for modified
15versions, except that this permission notice may be included in
16translations approved by the Free Software Foundation instead of in
17the original English.
18..
19.de TQ
20.br
21.ns
22.TP \\$1
23..
24.\" Like TP, but if specified indent is more than half
25.\" the current line-length - indent, use the default indent.
26.de Tp
27.ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
28.el .TP "\\$1"
29..
30.TH GROFF_FONT @MAN5EXT@ "@MDATE@" "Groff Version @VERSION@"
31.SH NAME
32groff_font \- format of groff device and font description files
33.SH DESCRIPTION
34The groff font format is roughly a superset of the ditroff
35font format.
36Unlike the ditroff font format, there is no associated binary
37format.
38The font files for device
39.I name
40are stored in a directory
41.BI dev name.
42There are two types of file: a
43device description file called
44.B DESC
45and for each font
46.I F
47a font file called
48.IR F .
49These are text files;
50there is no associated binary format.
51.SS DESC file format
52The DESC file can contain the following types of line:
53.TP
54.BI res\  n
55There are
56.I n
57machine units per inch.
58.TP
59.BI hor\  n
60The horizontal resolution is
61.I n
62machine units.
63.TP
64.BI vert\  n
65The vertical resolution is
66.I n
67machine units.
68.TP
69.BI sizescale\  n
70The scale factor for pointsizes.
71By default this has a value of 1.
72One
73.I
74scaled point
75is equal to
76one
77.RI point/ n .
78The arguments to the
79.B unitwidth
80and
81.B sizes
82commands are given in scaled points.
83.TP
84.BI unitwidth\  n
85Quantities in the font files are given in machine units
86for fonts whose point size is
87.I n 
88scaled points.
89.TP
90.BI prepro\  program
91Call
92.I program
93as a preprocessor.
94.TP
95.BI postpro\  program
96Use
97.I program
98as the postprocessor.
99.TP
100.B tcommand
101This means that the postprocessor can handle the
102.B t
103and
104.B u
105output commands.
106.TP
107.BI sizes\  s1\ s2\|.\|.\|.\|sn\  0
108This means that the device has fonts at
109.IR s1 ,
110.IR s2 ,\|.\|.\|.\| sn
111scaled points.
112The list of sizes must be terminated by a
113.BR 0 .
114Each
115.BI s i
116can also be a range of sizes
117.IR m \- n .
118The list can extend over more than one line.
119.TP
120.BI styles\  S1\ S2\|.\|.\|.\|Sm
121The first
122.I m
123font positions will be associated with styles
124.IR S1\|.\|.\|.\|Sm .
125.TP
126.BI fonts\  n\ F1\ F2\ F3\|.\|.\|.\|Fn
127Fonts
128.I F1\|.\|.\|.\|Fn
129will be mounted in the font positions 
130.IR m +1,\|.\|.\|., m + n
131where
132.I m
133is the number of styles.
134This command may extend over more than one line.
135A font name of
136.B 0
137will cause no font to be mounted on the corresponding font position.
138.TP
139.BI family\  fam
140The default font family is
141.IR fam .
142.TP
143.B use_charnames_in_special
144This command indicates that troff should encode named characters inside
145special commands.
146.TP
147.B pass_filenames
148requests that troff tells the driver the source file name being processed.
149This is achieved by another tcommand:
150.B F
151.IR filename .
152.TP
153.B charset
154This line and everything following in the file are ignored.
155It is allowed for the sake of backwards compatibility.
156.TP
157.BI print\  program
158Use
159.I program
160as the spooler program for printing.
161If omitted, the
162.B \-l
163and
164.B \-L
165options of
166.B groff
167are ignored.
168.LP
169The res, unitwidth, fonts and sizes lines are compulsory.
170Other commands are ignored by
171.B troff
172but may be used by postprocessors to store arbitrary information
173about the device in the DESC file.
174.LP
175Here a list of obsolete keywords which are recognized by
176.B groff
177but completely ignored:
178.BR spare1 ,
179.BR spare2 ,
180.BR biggestfont .
181.SS Font file format
182A font file has two sections. The first section is a sequence
183of lines each containing a sequence of blank delimited
184words; the first word in the line is a key, and subsequent
185words give a value for that key.
186.TP
187.BI name\  F
188The name of the font is
189.IR F .
190.TP
191.BI spacewidth\  n
192The normal width of a space is
193.IR n .
194.TP
195.BI slant\  n
196The characters of the font have a slant of
197.I n
198degrees. (Positive means forward.)
199.TP
200.BI ligatures\  lig1\ lig2\|.\|.\|.\|lign\ \fR[ 0 \fR]
201Characters
202.IR lig1 ,
203.IR lig2 ,\|.\|.\|., lign
204are ligatures; possible ligatures are
205.BR ff ,
206.BR fi ,
207.BR fl ,
208.B ffi
209and
210.BR ffl .
211For backwards compatibility, the list of ligatures may be terminated
212with a
213.BR 0.
214The list of ligatures may not extend over more than one line.
215.TP
216.B special
217The font is
218.IR special ;
219this means that when a character is requested that is not present in
220the current font, it will be searched for in any special fonts that
221are mounted.
222.LP
223Other commands are ignored by
224.B troff
225but may be used by postprocessors to store arbitrary information
226about the font in the font file.
227.LP
228The first section can contain comments which start with the
229.B #
230character and extend to the end of a line.
231.LP
232The second section contains one or two subsections.
233It must contain a
234.I charset
235subsection
236and it may also contain a
237.I kernpairs
238subsection.
239These subsections can appear in any order.
240Each subsection starts with a word on a line by itself.
241.LP
242The word
243.B charset
244starts the charset subsection.
245The
246.B charset
247line is followed by a sequence of lines.
248Each line gives information for one character.
249A line comprises a number of fields separated
250by blanks or tabs. The format is
251.IP
252.I name metrics type code 
253.RI [ entity_name ]
254.RB [ --
255.IR comment ]
256.LP
257.I name
258identifies the character:
259if
260.I name
261is a single character
262.I c
263then it corresponds to the groff input character
264.IR c ;
265if it is of the form
266.BI \e c
267where c is a single character, then it
268corresponds to the groff input character
269.BI \e c\fR;
270otherwise it corresponds to the groff input character
271.BI \e[ name ]
272(if it is exactly two characters
273.I xx
274it can be entered as
275.BI \e( xx\fR).
276Groff supports eight bit characters; however some utilities
277has difficulties with eight bit characters.
278For this reason, there is a convention that the name
279.BI char n
280is equivalent to the single character whose code is
281.I n .
282For example,
283.B char163
284would be equivalent to the character with code 163
285which is the pounds sterling sign in ISO Latin-1.
286The name
287.B \-\-\-
288is special and indicates that the character is unnamed;
289such characters can only be used by means of the
290.B \eN
291escape sequence in
292.BR troff .
293.LP
294The
295.I type
296field gives the character type:
297.TP
2981
299means the character has an descender, for example, p;
300.TP
3012
302means the character has an ascender, for example, b;
303.TP
3043
305means the character has both an ascender and a descender, for example,
306(.
307.LP
308The
309.I code
310field gives the code which the postprocessor uses to print the character.
311The character can also be input to groff using this code by means of the
312.B \eN
313escape sequence.
314The code can be any integer.
315If it starts with a
316.B 0
317it will be interpreted as octal;
318if it starts with
319.B 0x
320or
321.B 0X
322it will be intepreted as hexadecimal.
323.LP
324The
325.I entity_name
326field gives an ascii string identifying the glyph which the postprocessor
327uses to print the character.
328This field is optional and has been introduced so that the html device driver
329can encode its character set.
330For example, the character `\e[Po]' is represented as `£' in html 4.0.
331.LP
332Anything on the line after the encoding field resp. after `-\&-' will
333be ignored.
334.LP
335The
336.I metrics
337field has the form:
338.IP
339.IR width [\fB, height [\fB, depth [\fB, italic_correction [\fB, \
340left_italic_correction [\fB, subscript_correction ]]]]]
341.LP
342There must not be any spaces between these subfields.
343Missing subfields are assumed to be 0.
344The subfields are all decimal integers.
345Since there is no associated binary format, these
346values are not required to fit into a variable of type
347.B char
348as they are in ditroff.
349The
350.I width
351subfields gives the width of the character.
352The
353.I height
354subfield gives the height of the character (upwards is positive);
355if a character does not extend above the baseline, it should be
356given a zero height, rather than a negative height.
357The
358.I depth
359subfield gives the depth of the character, that is, the distance
360below the lowest point below the baseline to which the
361character extends (downwards is positive);
362if a character does not extend below above the baseline, it should be
363given a zero depth, rather than a negative depth.
364The
365.I italic_correction
366subfield gives the amount of space that should be added after the
367character when it is immediately to be followed by a character
368from a roman font.
369The
370.I left_italic_correction
371subfield gives the amount of space that should be added before the
372character when it is immediately to be preceded by a character
373from a roman font.
374The
375.I subscript_correction
376gives the amount of space that should be added after a character
377before adding a subscript.
378This should be less than the italic correction.
379.LP
380A line in the charset section can also have the format
381.IP
382.I
383name \fB"
384.LP
385This indicates that
386.I name
387is just another name for the character mentioned in the
388preceding line.
389.LP
390The word
391.B kernpairs
392starts the kernpairs section.
393This contains a sequence of lines of the form:
394.IP
395.I
396c1 c2 n
397.LP
398This means that when character
399.I c1
400appears next to character
401.I c2
402the space between them should be increased by
403.IR n .
404Most entries in kernpairs section will have a negative value for
405.IR n .
406.SH FILES
407.Tp \w'@FONTDIR@/devname/DESC'u+3n
408.BI @FONTDIR@/dev name /DESC
409Device description file for device
410.IR name .
411.TP
412.BI @FONTDIR@/dev name / F
413Font file for font
414.I F
415of device
416.IR name .
417.SH "SEE ALSO"
418.BR groff_out (@MAN5EXT@),
419.BR @g@troff (@MAN1EXT@).
420