groff_font.man revision 18099
1114402Sru.ig \"-*- nroff -*-
2114402SruCopyright (C) 1989-1995 Free Software Foundation, Inc.
3114402Sru
4114402SruPermission is granted to make and distribute verbatim copies of
5114402Sruthis manual provided the copyright notice and this permission notice
6114402Sruare preserved on all copies.
7114402Sru
8114402SruPermission is granted to copy and distribute modified versions of this
9114402Srumanual under the conditions for verbatim copying, provided that the
10114402Sruentire resulting derived work is distributed under the terms of a
11114402Srupermission notice identical to this one.
12114402Sru
13114402SruPermission is granted to copy and distribute translations of this
14114402Srumanual into another language, under the above conditions for modified
15114402Sruversions, except that this permission notice may be included in
16114402Srutranslations approved by the Free Software Foundation instead of in
17114402Sruthe original English.
18114402Sru..
19114402Sru.de TQ
20114402Sru.br
21114402Sru.ns
22114402Sru.TP \\$1
23114402Sru..
24114402Sru.\" Like TP, but if specified indent is more than half
25114402Sru.\" the current line-length - indent, use the default indent.
26114402Sru.de Tp
27114402Sru.ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
28114402Sru.el .TP "\\$1"
29114402Sru..
30114402Sru.TH GROFF_FONT @MAN5EXT@ "@MDATE@" "Groff Version @VERSION@"
31114402Sru.SH NAME
32114402Srugroff_font \- format of groff device and font description files
33114402Sru.SH DESCRIPTION
34114402SruThe groff font format is roughly a superset of the ditroff
35114402Srufont format.
36114402SruUnlike the ditroff font format, there is no associated binary
37114402Sruformat.
38114402SruThe font files for device
39114402Sru.I name
40114402Sruare stored in a directory
41114402Sru.BI dev name.
42114402SruThere are two types of file: a
43114402Srudevice description file called
44114402Sru.B DESC
45114402Sruand for each font
46114402Sru.I F
47114402Srua font file called
48114402Sru.IR F .
49114402SruThese are text files;
50114402Sruthere is no associated binary format.
51114402Sru.SS DESC file format
52114402SruThe DESC file can contain the following types of line:
53114402Sru.TP
54114402Sru.BI res\  n
55114402SruThere are
56114402Sru.I n
57114402Srumachine units per inch.
58114402Sru.TP
59114402Sru.BI hor\  n
60114402SruThe horizontal resolution is
61114402Sru.I n
62114402Srumachine units.
63114402Sru.TP
64114402Sru.BI vert\  n
65114402SruThe vertical resolution is
66114402Sru.I n
67114402Srumachine units.
68114402Sru.TP
69114402Sru.BI sizescale\  n
70114402SruThe scale factor for pointsizes.
71114402SruBy default this has a value of 1.
72114402SruOne
73114402Sru.I
74114402Sruscaled point
75114402Sruis equal to
76114402Sruone
77114402Sru.RI point/ n .
78114402SruThe arguments to the
79114402Sru.B unitwidth
80114402Sruand
81114402Sru.B sizes
82114402Srucommands are given in scaled points.
83114402Sru.TP
84114402Sru.BI unitwidth\  n
85114402SruQuantities in the font files are given in machine units
86114402Srufor fonts whose point size is
87114402Sru.I n 
88114402Sruscaled points.
89114402Sru.TP
90114402Sru.B tcommand
91114402SruThis means that the postprocessor can handle the
92114402Sru.B t
93114402Sruand
94114402Sru.B u
95114402Sruoutput commands.
96114402Sru.TP
97114402Sru.BI sizes\  s1\ s2\|.\|.\|.\|sn\  0
98114402SruThis means that the device has fonts at
99114402Sru.IR s1 ,
100114402Sru.IR s2 ,\|.\|.\|.\| sn
101114402Sruscaled points.
102114402SruThe list of sizes must be terminated by a
103114402Sru.BR 0 .
104114402SruEach
105114402Sru.BI s i
106114402Srucan also be a range of sizes
107114402Sru.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