groff: update vendor branch to v1.20.1
[dragonfly.git] / contrib / groff / man / groff_font.man
CommitLineData
92d0a6a6 1.ig
4d3e9548
JL
2Copyright (C) 1989-1995, 2001, 2002, 2003, 2004, 2006, 2007, 2008,
3 2009
4 Free Software Foundation, Inc.
92d0a6a6
JR
5
6Permission is granted to make and distribute verbatim copies of
7this manual provided the copyright notice and this permission notice
8are preserved on all copies.
9
10Permission is granted to copy and distribute modified versions of this
11manual under the conditions for verbatim copying, provided that the
12entire resulting derived work is distributed under the terms of a
13permission notice identical to this one.
14
15Permission is granted to copy and distribute translations of this
16manual into another language, under the above conditions for modified
17versions, except that this permission notice may be included in
18translations approved by the Free Software Foundation instead of in
19the original English.
20..
21.
22.do nr groff_font_C \n[.C]
23.cp 0
24.
92d0a6a6
JR
25.
26.\" Like TP, but if specified indent is more than half
27.\" the current line-length - indent, use the default indent.
28.de Tp
29. ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
30. el .TP "\\$1"
31..
32.
33.
34.TH GROFF_FONT @MAN5EXT@ "@MDATE@" "Groff Version @VERSION@"
35.
36.
37.SH NAME
38groff_font \- format of groff device and font description files
39.
40.
41.SH DESCRIPTION
42The groff font format is roughly a superset of the ditroff
43font format.
44.
45The font files for device
46.I name
47are stored in a directory
465b256c
JR
48.BI dev name\c
49\&.
92d0a6a6
JR
50.
51There are two types of file: a
52device description file called
53.B DESC
4d3e9548 54and for each font\~\c
92d0a6a6 55.I F
4d3e9548 56a font file called\~\c
92d0a6a6
JR
57.IR F .
58.
59These are text files;
60unlike the ditroff font format,
61there is no associated binary format.
62.
63.
64.SS DESC file format
65.
66The DESC file can contain the following types of line as shown below.
67.
68Later entries in the file override previous values.
69.
4d3e9548
JL
70.LP
71Empty lines are ignored.
72.
92d0a6a6
JR
73.TP
74.B charset
75This line and everything following in the file are ignored.
76.
77It is allowed for the sake of backwards compatibility.
78.
79.TP
80.BI family\ fam
81The default font family is
82.IR fam .
83.
84.TP
4d3e9548 85.BI fonts\ n\ F1\ F2\ F3\ \|.\|.\|.\|\ Fn
92d0a6a6 86Fonts
4d3e9548
JL
87.IR F1 ,\ \|.\|.\|.,\ Fn
88are mounted in the font positions
89.IR m \|+\|1,\ \|.\|.\|.,\ m \|+\| n
92d0a6a6
JR
90where
91.I m
92is the number of styles.
93.
94This command may extend over more than one line.
95.
4d3e9548 96A font name of\~\c
92d0a6a6 97.B 0
4d3e9548 98causes no font to be mounted on the corresponding font position.
92d0a6a6
JR
99.
100.TP
101.BI hor\ n
102The horizontal resolution is
4d3e9548 103.IR n \~\c
92d0a6a6
JR
104machine units.
105.
106.TP
465b256c
JR
107.BI image_generator\ string
108Needed for
4d3e9548 109.B \%grohtml
465b256c 110only.
4d3e9548 111.
465b256c
JR
112It specifies the program to generate PNG images from
113PostScript input.
4d3e9548 114.
465b256c
JR
115Under GNU/Linux this is usually
116.I gs
117but under other systems (notably cygwin) it might be set to another name.
118.
119.TP
92d0a6a6
JR
120.BI paperlength\ n
121The physical vertical dimension of the output medium in machine units.
122.
123This isn't used by
124.B troff
125itself but by output devices.
126.
127Deprecated.
128.
129Use
130.B papersize
131instead.
132.
133.TP
134.BI papersize\ string
135Select a paper size.
136.
137Valid values for
138.I string
139are the ISO paper types A0-A7, B0-B7, C0-C7, D0-D7, DL, and the US paper
140types letter, legal, tabloid, ledger, statement, executive, com10, and
141monarch.
142.
143Case is not significant for
144.IR string
145if it holds predefined paper types.
146.
147Alternatively,
148.I string
149can be a file name (e.g.\& `/etc/papersize'); if the file can be opened,
150.B groff
151reads the first line and tests for the above paper sizes.
152.
153Finally,
154.I string
155can be a custom paper size in the format
156.IB length , width
157(no spaces before and after the comma).
158.
159Both
160.I length
161and
162.I width
163must have a unit appended; valid values are `i' for inches, `c' for
164centimeters, `p' for points, and `P' for picas.
165.
166Example:
167.BR 12c,235p .
168.
169An argument which starts with a digit is always treated as a custom paper
170format.
171.
172.B papersize
173sets both the vertical and horizontal dimension of the output medium.
174.
175.IP
176More than one argument can be specified;
177.B groff
178scans from left to right and uses the first valid paper specification.
179.
180.TP
181.BI paperwidth\ n
182The physical horizontal dimension of the output medium in machine units.
183.
184Deprecated.
185.
186Use
187.B papersize
188instead.
189.
190This isn't used by
191.BR troff
192itself but by output devices.
193.
194.TP
195.B pass_filenames
196Make troff tell the driver the source file name being processed.
197.
198This is achieved by another tcommand:
4d3e9548 199.BR F \~\c
92d0a6a6
JR
200.IR filename .
201.
202.TP
203.BI postpro\ program
204Use
205.I program
206as the postprocessor.
207.
208.TP
209.BI prepro\ program
210Call
211.I program
212as a preprocessor.
213.
214.TP
215.BI print\ program
216Use
217.I program
218as the spooler program for printing.
219.
220If omitted, the
221.B \-l
222and
223.B \-L
224options of
225.B groff
226are ignored.
227.
228.TP
229.BI res\ n
230There are
231.I n
232machine units per inch.
233.
234.TP
4d3e9548 235.BI sizes\ s1\ s2\ \|.\|.\|.\|\ sn\ 0
92d0a6a6
JR
236This means that the device has fonts at
237.IR s1 ,
4d3e9548 238.IR s2 ,\ \|.\|.\|.,\ sn
92d0a6a6
JR
239scaled points.
240.
241The list of sizes must be terminated by a
242.BR 0 .
243.
244Each
245.I si
246can also be a range of sizes
247.IR m \- n .
248.
249The list can extend over more than one line.
250.
251.TP
252.BI sizescale\ n
4d3e9548 253The scale factor for point sizes.
92d0a6a6
JR
254.
255By default this has a value of 1.
256.
257One
258.I
259scaled point
260is equal to
261one
4d3e9548 262.RI point\|/\| n .
92d0a6a6
JR
263.
264The arguments to the
265.B unitwidth
266and
267.B sizes
268commands are given in scaled points.
269.
270.TP
4d3e9548 271.BI styles\ S1\ S2\ \|.\|.\|.\|\ Sm
92d0a6a6
JR
272The first
273.I m
4d3e9548
JL
274font positions are associated with styles
275.IR S1 ,\ \|.\|.\|.,\ Sm .
92d0a6a6
JR
276.
277.TP
278.B tcommand
279This means that the postprocessor can handle the
280.B t
4d3e9548 281and\~\c
92d0a6a6
JR
282.B u
283output commands.
284.
285.TP
4d3e9548
JL
286.B unicode
287Indicate that the output device supports the complete Unicode
288repertoire.
289.
290Useful only for devices which produce
291.I character entities
292instead of glyphs.
293.
294.IP
295If
296.B unicode
297is present, no
298.B charset
299section is required in the font description files since the Unicode
300handling built into
301.B groff
302is used.
303.
304However, if there are entries in a
305.B charset
306section, they either override the default mappings for those
307particular characters or add new mappings (normally for composite
308characters).
309.
310.IP
311This is used for
312.BR \-Tutf8 ,
313.BR \-Thtml ,
314and
315.BR \-Txhtml .
316.
317.TP
92d0a6a6
JR
318.BI unitwidth\ n
319Quantities in the font files are given in machine units
320for fonts whose point size is
4d3e9548 321.IR n \~\c
92d0a6a6
JR
322scaled points.
323.
324.TP
465b256c 325.B unscaled_charwidths
4d3e9548
JL
326Make the font handling module always return unscaled glyph widths.
327.
465b256c 328Needed for the
4d3e9548 329.B \%grohtml
465b256c
JR
330device.
331.
332.TP
92d0a6a6 333.B use_charnames_in_special
4d3e9548 334This command indicates that troff should encode named glyphs inside
92d0a6a6
JR
335special commands.
336.
337.TP
338.BI vert\ n
339The vertical resolution is
4d3e9548 340.IR n \~\c
92d0a6a6
JR
341machine units.
342.
343.LP
344The
345.BR res ,
346.BR unitwidth ,
347.BR fonts ,
348and
349.B sizes
350lines are compulsory.
351.
352Not all commands in the DESC file are used by
353.B troff
354itself; some of the keywords (or even additional ones) are used by
355postprocessors to store arbitrary information about the device.
356.
357.LP
358Here a list of obsolete keywords which are recognized by
359.B groff
360but completely ignored:
361.BR spare1 ,
362.BR spare2 ,
363.BR biggestfont .
364.
365.
366.SS Font file format
367.
4d3e9548
JL
368A font file has two sections;
369empty lines are ignored in both of them.
370.
371.LP
92d0a6a6
JR
372The first section is a sequence
373of lines each containing a sequence of blank delimited
374words; the first word in the line is a key, and subsequent
375words give a value for that key.
376.
377.TP
4d3e9548
JL
378.BI ligatures\ lig1\ lig2\ \|.\|.\|.\|\ lign\ \fR[ 0 \fR]
379Glyphs
92d0a6a6 380.IR lig1 ,
4d3e9548 381.IR lig2 ,\ \|.\|.\|.,\ lign
92d0a6a6
JR
382are ligatures; possible ligatures are
383.BR ff ,
384.BR fi ,
385.BR fl ,
4d3e9548 386.BR ffi ,
92d0a6a6
JR
387and
388.BR ffl .
389.
390For backwards compatibility, the list of ligatures may be terminated
4d3e9548 391with a\~\c
92d0a6a6
JR
392.BR 0.
393.
394The list of ligatures may not extend over more than one line.
395.
396.TP
397.BI name\ F
4d3e9548 398The name of the font is\~\c
92d0a6a6
JR
399.IR F .
400.
401.TP
402.BI slant\ n
4d3e9548
JL
403The glyphs of the font have a slant of
404.IR n \~\c
92d0a6a6
JR
405degrees.
406.
407(Positive means forward.)
408.
409.TP
410.BI spacewidth\ n
4d3e9548 411The normal width of a space is\~\c
92d0a6a6
JR
412.IR n .
413.
414.TP
415.B special
416The font is
417.IR special ;
4d3e9548
JL
418this means that when a glyph is requested that is not present in
419the current font, it is searched for in any special fonts that are
420mounted.
92d0a6a6
JR
421.
422.LP
423Other commands are ignored by
424.B troff
425but may be used by postprocessors to store arbitrary information
426about the font in the font file.
427.
428.LP
429The first section can contain comments which start with the
430.B #
431character and extend to the end of a line.
432.
433.LP
434The second section contains one or two subsections.
435.
436It must contain a
437.I charset
438subsection
439and it may also contain a
440.I kernpairs
441subsection.
442.
443These subsections can appear in any order.
444.
445Each subsection starts with a word on a line by itself.
446.
447.LP
448The word
449.B charset
450starts the charset subsection.
451.
452The
453.B charset
454line is followed by a sequence of lines.
455.
4d3e9548 456Each line gives information for one glyph.
92d0a6a6
JR
457.
458A line comprises a number of fields separated
459by blanks or tabs.
460.
461The format is
462.
463.IP
4d3e9548 464.I name metrics type code
92d0a6a6 465.RI [ entity_name ]
4d3e9548 466.RB [ \-\-
92d0a6a6
JR
467.IR comment ]
468.
469.LP
470.I name
4d3e9548 471identifies the glyph:
92d0a6a6
JR
472if
473.I name
4d3e9548 474is a single glyph
92d0a6a6
JR
475.I c
476then it corresponds to the groff input character
477.IR c ;
478if it is of the form
479.BI \[rs] c
480where c is a single character, then it
481corresponds to the special character
482.BI \[rs][ c ]\fR;
483otherwise it corresponds to the groff input character
484.BI \[rs][ name ]\fR.
485.
486If it is exactly two characters
487.I xx
488it can be entered as
489.BI \[rs]( xx\fR.
490.
491Note that single-letter special characters can't be accessed as
492.BI \[rs] c\fR;
4d3e9548 493the only exception is `\[rs]\-' which is identical to `\[rs][\-]'.
92d0a6a6
JR
494.
495The name
496.B \-\-\-
4d3e9548
JL
497is special and indicates that the glyph is unnamed;
498such glyphs can only be used by means of the
92d0a6a6
JR
499.B \[rs]N
500escape sequence in
501.BR troff .
502.
503.LP
92d0a6a6
JR
504The
505.I type
4d3e9548 506field gives the glyph type:
92d0a6a6
JR
507.
508.TP
5091
4d3e9548 510means the glyph has a descender, for example, `p';
92d0a6a6
JR
511.
512.TP
5132
4d3e9548 514means the glyph has an ascender, for example, `b';
92d0a6a6
JR
515.
516.TP
5173
4d3e9548
JL
518means the glyph has both an ascender and a descender, for example,
519`('.
92d0a6a6
JR
520.
521.LP
522The
523.I code
4d3e9548 524field gives the code which the postprocessor uses to print the glyph.
92d0a6a6 525.
4d3e9548 526The glyph can also be input to groff using this code by means of the
92d0a6a6
JR
527.B \[rs]N
528escape sequence.
529.
530The code can be any integer.
531.
4d3e9548 532If it starts with a\~\c
92d0a6a6 533.B 0
4d3e9548 534it is interpreted as octal;
92d0a6a6
JR
535if it starts with
536.B 0x
537or
538.B 0X
4d3e9548 539it is intepreted as hexadecimal.
92d0a6a6
JR
540.
541Note, however, that the
542.B \[rs]N
543escape sequence only accepts a decimal integer.
544.
545.LP
546The
547.I entity_name
4d3e9548
JL
548field gives an ASCII string identifying the glyph which the postprocessor
549uses to print that glyph.
92d0a6a6 550.
4d3e9548
JL
551This field is optional and is currently used by
552.B grops
553to build sub-encoding arrays for PS fonts containing more than 256 glyphs.
92d0a6a6 554.
4d3e9548
JL
555(It has also been used for
556.BR \%grohtml 's
557entity names but for efficiency reasons this data is now compiled directly
558into
559.BR \%grohtml .)
92d0a6a6
JR
560.
561.LP
4d3e9548 562Anything on the line after the encoding field or `\-\-' are ignored.
92d0a6a6
JR
563.
564.LP
565The
566.I metrics
567field has the form (in one line; it is broken here for the sake of
568readability):
569.
570.IP
465b256c
JR
571.I width\c
572.RI [\fB, height\c
573.RI [\fB, depth\c
574.RI [\fB, italic-correction
92d0a6a6 575.br
465b256c
JR
576.RI [\fB, left-italic-correction\c
577.RI [\fB, subscript-correction ]]]]]
92d0a6a6
JR
578.
579.LP
580There must not be any spaces between these subfields.
581.
4d3e9548 582Missing subfields are assumed to be\~0.
92d0a6a6
JR
583.
584The subfields are all decimal integers.
585.
586Since there is no associated binary format, these
587values are not required to fit into a variable of type
588.B char
589as they are in ditroff.
590.
591The
592.I width
4d3e9548 593subfields gives the width of the glyph.
92d0a6a6
JR
594.
595The
596.I height
4d3e9548
JL
597subfield gives the height of the glyph (upwards is positive);
598if a glyph does not extend above the baseline, it should be
92d0a6a6
JR
599given a zero height, rather than a negative height.
600.
601The
602.I depth
4d3e9548 603subfield gives the depth of the glyph, that is, the distance
92d0a6a6 604below the lowest point below the baseline to which the
4d3e9548
JL
605glyph extends (downwards is positive);
606if a glyph does not extend below above the baseline, it should be
92d0a6a6
JR
607given a zero depth, rather than a negative depth.
608.
609The
610.I italic-correction
611subfield gives the amount of space that should be added after the
4d3e9548 612glyph when it is immediately to be followed by a glyph
92d0a6a6
JR
613from a roman font.
614.
615The
616.I left-italic-correction
617subfield gives the amount of space that should be added before the
4d3e9548 618glyph when it is immediately to be preceded by a glyph
92d0a6a6
JR
619from a roman font.
620.
621The
622.I subscript-correction
4d3e9548 623gives the amount of space that should be added after a glyph
92d0a6a6
JR
624before adding a subscript.
625.
626This should be less than the italic correction.
627.
628.LP
629A line in the charset section can also have the format
630.
631.IP
632.I
633name \fB"
634.
635.LP
636This indicates that
637.I name
4d3e9548 638is just another name for the glyph mentioned in the
92d0a6a6
JR
639preceding line.
640.
641.LP
642The word
643.B kernpairs
644starts the kernpairs section.
645.
646This contains a sequence of lines of the form:
647.
648.IP
649.I c1 c2 n
650.
651.LP
4d3e9548 652This means that when glyph
92d0a6a6 653.I c1
4d3e9548 654appears next to glyph
92d0a6a6 655.I c2
4d3e9548 656the space between them should be increased by\~\c
92d0a6a6
JR
657.IR n .
658.
4d3e9548 659Most entries in kernpairs section have a negative value for\~\c
92d0a6a6
JR
660.IR n .
661.
662.
663.SH FILES
664.
665.Tp \w'@FONTDIR@/devname/DESC'u+3n
666.BI @FONTDIR@/dev name /DESC
667Device description file for device
668.IR name .
669.
670.TP
671.BI @FONTDIR@/dev name / F
4d3e9548 672Font file for font\~\c
92d0a6a6
JR
673.I F
674of device
675.IR name .
676.
677.
678.SH "SEE ALSO"
679.
680.BR groff_out (@MAN5EXT@),
681.BR @g@troff (@MAN1EXT@).
682.
683.cp \n[groff_font_C]
684.
685.\" Local Variables:
686.\" mode: nroff
687.\" End: