groff_font.man revision 18099
1.ig \"-*- nroff -*-
2Copyright (C) 1989-1995 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.B tcommand
91This means that the postprocessor can handle the
92.B t
93and
94.B u
95output commands.
96.TP
97.BI sizes\  s1\ s2\|.\|.\|.\|sn\  0
98This means that the device has fonts at
99.IR s1 ,
100.IR s2 ,\|.\|.\|.\| sn
101scaled points.
102The list of sizes must be terminated by a
103.BR 0 .
104Each
105.BI s i
106can also be a range of sizes
107.IR m \- n .
108The list can extend over more than one line.
109.TP
110.BI styles\  S1\ S2\|.\|.\|.\|Sm
111The first
112.I m
113font positions will be associated with styles
114.IR S1\|.\|.\|.\|Sm .
115.TP
116.BI fonts\  n\ F1\ F2\ F3\|.\|.\|.\|Fn
117Fonts
118.I F1\|.\|.\|.\|Fn
119will be mounted in the font positions 
120.IR m +1,\|.\|.\|., m + n
121where
122.I m
123is the number of styles.
124This command may extend over more than one line.
125A font name of
126.B 0
127will cause no font to be mounted on the corresponding font position.
128.TP
129.BI family\  fam
130The default font family is
131.IR fam .
132.TP
133.B charset
134This line and everything following in the file are ignored.
135It is allowed for the sake of backwards compatibility.
136.LP
137The res, unitwidth, fonts and sizes lines are compulsory.
138Other commands are ignored by
139.B troff
140but may be used by postprocessors to store arbitrary information
141about the device in the DESC file.
142.SS Font file format
143A font file has two sections. The first section is a sequence
144of lines each containing a sequence of blank delimited
145words; the first word in the line is a key, and subsequent
146words give a value for that key.
147.TP
148.BI name\  F
149The name of the font is
150.IR F .
151.TP
152.BI spacewidth\  n
153The normal width of a space is
154.IR n .
155.TP
156.BI slant\  n
157The characters of the font have a slant of
158.I n
159degrees. (Positive means forward.)
160.TP
161.BI ligatures\  lig1\ lig2\|.\|.\|.\|lign\ \fR[ 0 \fR]
162Characters
163.IR lig1 ,
164.IR lig2 ,\|.\|.\|., lign
165are ligatures; possible ligatures are
166.BR ff ,
167.BR fi ,
168.BR fl 
169and
170.BR ffl .
171For backwards compatibility, the list of ligatures may be terminated
172with a
173.BR 0.
174The list of ligatures may not extend over more than one line.
175.TP
176.B special
177The font is
178.IR special ;
179this means that when a character is requested that is not present in
180the current font, it will be searched for in any special fonts that
181are mounted.
182.LP
183Other commands are ignored by
184.B troff
185but may be used by postprocessors to store arbitrary information
186about the font in the font file.
187.LP
188The first section can contain comments which start with the
189.B #
190character and extend to the end of a line.
191.LP
192The second section contains one or two subsections.
193It must contain a
194.I charset
195subsection
196and it may also contain a
197.I kernpairs
198subsection.
199These subsections can appear in any order.
200Each subsection starts with a word on a line by itself.
201.LP
202The word
203.B charset
204starts the charset subsection.
205The
206.B charset
207line is followed by a sequence of lines.
208Each line gives information for one character.
209A line comprises a number of fields separated
210by blanks or tabs. The format is
211.IP
212.I
213name metrics type code comment
214.LP
215.I name
216identifies the character:
217if
218.I name
219is a single character
220.I c
221then it corresponds to the groff input character
222.IR c ;
223if it is of the form
224.BI \e c
225where c is a single character, then it
226corresponds to the groff input character
227.BI \e c\fR;
228otherwise it corresponds to the groff input character
229.BI \e[ name ]
230(if it is exactly two characters
231.I xx
232it can be entered as
233.BI \e( xx\fR.)
234Groff supports eight bit characters; however some utilities
235has difficulties with eight bit characters.
236For this reason, there is a convention that the name
237.BI char n
238is equivalent to the single character whose code is
239.I n .
240For example,
241.B char163
242would be equivalent to the character with code 163
243which is the pounds sterling sign in ISO Latin-1.
244The name
245.B \-\-\-
246is special and indicates that the character is unnamed;
247such characters can only be used by means of the
248.B \eN
249escape sequence in
250.BR troff .
251.LP
252The
253.I type
254field gives the character type:
255.TP
2561
257means the character has an descender, for example, p;
258.TP
2592
260means the character has an ascender, for example, b;
261.TP
2623
263means the character has both an ascender and a descender, for example,
264(.
265.LP
266The
267.I code
268field gives the code which the postprocessor uses to print the character.
269The character can also be input to groff using this code by means of the
270.B \eN
271escape sequence.
272The code can be any integer.
273If it starts with a
274.B 0
275it will be interpreted as octal;
276if it starts with
277.B 0x
278or
279.B 0X
280it will be intepreted as hexadecimal.
281.LP
282Anything on the line after the code field will be ignored.
283.LP
284The
285.I metrics
286field has the form:
287.IP
288.IR width [\fB, height [\fB, depth [\fB, italic_correction [\fB, \
289left_italic_correction [\fB, subscript_correction ]]]]]
290.LP
291There must not be any spaces between these subfields.
292Missing subfields are assumed to be 0.
293The subfields are all decimal integers.
294Since there is no associated binary format, these
295values are not required to fit into a variable of type
296.B char
297as they are in ditroff.
298The
299.I width
300subfields gives the width of the character.
301The
302.I height
303subfield gives the height of the character (upwards is positive);
304if a character does not extend above the baseline, it should be
305given a zero height, rather than a negative height.
306The
307.I depth
308subfield gives the depth of the character, that is, the distance
309below the lowest point below the baseline to which the
310character extends (downwards is positive);
311if a character does not extend below above the baseline, it should be
312given a zero depth, rather than a negative depth.
313The
314.I italic_correction
315subfield gives the amount of space that should be added after the
316character when it is immediately to be followed by a character
317from a roman font.
318The
319.I left_italic_correction
320subfield gives the amount of space that should be added before the
321character when it is immediately to be preceded by a character
322from a roman font.
323The
324.I subscript_correction
325gives the amount of space that should be added after a character
326before adding a subscript.
327This should be less than the italic correction.
328.LP
329A line in the charset section can also have the format
330.IP
331.I
332name \fB"
333.LP
334This indicates that
335.I name
336is just another name for the character mentioned in the
337preceding line.
338.LP
339The word
340.B kernpairs
341starts the kernpairs section.
342This contains a sequence of lines of the form:
343.IP
344.I
345c1 c2 n
346.LP
347This means that when character
348.I c1
349appears next to character
350.I c2
351the space between them should be increased by
352.IR n .
353Most entries in kernpairs section will have a negative value for
354.IR n .
355.SH FILES
356.Tp \w'@FONTDIR@/devname/DESC'u+3n
357.BI @FONTDIR@/dev name /DESC
358Device description file for device
359.IR name .
360.TP
361.BI @FONTDIR@/dev name / F
362Font file for font
363.I F
364of device
365.IR name .
366.SH "SEE ALSO"
367.BR groff_out (@MAN5EXT@),
368.BR @g@troff (@MAN1EXT@).
369