1 .TH GROFF_FONT @MAN5EXT@ "@MDATE@" "groff @VERSION@"
3 groff_font \- format of groff device and font description files
6 .\" ====================================================================
8 .\" ====================================================================
10 .\" Copyright (C) 1989-2018 Free Software Foundation, Inc.
12 .\" This file is part of groff (GNU roff), which is a free software
15 .\" You can redistribute it and/or modify it under the terms of the GNU
16 .\" General Public License as published by the Free Software Foundation,
17 .\" either version 2 of the License, or (at your option) any later
20 .\" You should have received a copy of the GNU General Public License
21 .\" along with this program. If not, see
22 .\" <http://www.gnu.org/licenses/gpl-2.0.html>.
25 .\" Save and disable compatibility mode (for, e.g., Solaris 10/11).
26 .do nr groff_font_C \n[.C]
30 .\" ====================================================================
32 .\" ====================================================================
34 The groff font format is roughly a superset of the ditroff
37 The font files for device
39 are stored in a directory
42 There are two types of file:
43 a device description file called
47 a font file called\~F.
50 unlike the ditroff font format,
51 there is no associated binary format.
54 .\" ====================================================================
56 .\" ====================================================================
60 file can contain the following types of line as shown below.
62 Later entries in the file override previous values.
65 Empty lines are ignored.
69 This line and everything following in the file are ignored.
71 It is allowed for the sake of backwards compatibility.
75 The default font family is
79 .BI "fonts " "n F1 F2 F3 \|.\|.\|.\| Fn"
81 .IR F1 ", \|.\|.\|., " Fn
82 are mounted in the font positions
83 .IR m "\|+\|1, \|.\|.\|., " m \|+\| n
86 is the number of styles.
88 This command may extend over more than one line.
92 causes no font to be mounted on the corresponding font position.
96 The horizontal resolution is
101 .BI "image_generator " string
106 It specifies the program to generate PNG images from
109 Under GNU/Linux this is usually
111 but under other systems (notably cygwin) it might be set to another
116 The physical vertical dimension of the output medium in machine units.
120 itself but by output devices.
129 .BI "papersize " string
134 are the ISO paper types A0\[en]A7, B0\[en]B7, C0\[en]C7, D0\[en]D7,
136 types letter, legal, tabloid, ledger, statement, executive, com10, and
139 Case is not significant for
141 if it holds predefined paper types.
145 can be a file name (e.g.\&
146 .IR /etc/papersize );
147 if the file can be opened,
149 reads the first line and tests for the above paper sizes.
153 can be a custom paper size in the format
155 (no spaces before and after the comma).
161 must have a unit appended; valid values are \[oq]i\[cq] for inches,
162 \[oq]c\[cq] for centimeters, \[oq]p\[cq] for points, and \[oq]P\[cq]
168 An argument which starts with a digit is always treated as a custom
172 sets both the vertical and horizontal dimension of the output medium.
175 More than one argument can be specified;
177 scans from left to right and uses the first valid paper specification.
181 The physical horizontal dimension of the output medium in machine units.
191 itself but by output devices.
195 Make troff tell the driver the source file name being processed.
197 This is achieved by another tcommand:
202 .BI "postpro " program
205 as the postprocessor.
208 .BI "prepro " program
217 as the spooler program for printing.
231 machine units per inch.
234 .BI "sizes " "s1 s2 \|.\|.\|.\| sn " 0
235 This means that the device has fonts at
237 .IR s2 ", \|.\|.\|., " sn
240 The list of sizes must be terminated by a
245 can also be a range of sizes
248 The list can extend over more than one line.
252 The scale factor for point sizes.
254 By default this has a value of 1.
267 commands are given in scaled points.
270 .BI "styles " "S1 S2 \|.\|.\|.\| Sm"
273 font positions are associated with styles
274 .IR S1 ", \|.\|.\|., " Sm .
278 This means that the postprocessor can handle the
286 Indicate that the output device supports the complete Unicode
289 Useful only for devices which produce
290 .I character entities
298 section is required in the font description files since the Unicode
303 However, if there are entries in a
305 section, they either override the default mappings for those
306 particular characters or add new mappings (normally for composite
318 Quantities in the font files are given in machine units
319 for fonts whose point size is
324 .B unscaled_charwidths
325 Make the font handling module always return unscaled glyph widths.
332 .B use_charnames_in_special
333 This command indicates that troff should encode named glyphs inside
338 The vertical resolution is
349 lines are compulsory.
351 Not all commands in the
355 itself; some of the keywords (or even additional ones) are used by
356 postprocessors to store arbitrary information about the device.
359 Here a list of obsolete keywords which are recognized by
361 but completely ignored:
367 .\" ====================================================================
369 .\" ====================================================================
371 A font file has two sections; empty lines are ignored in both of them.
374 The first section is a sequence of lines each containing a sequence of
375 blank delimited words; the first word in the line is a key, and
376 subsequent words give a value for that key.
379 .BI "ligatures " "lig1 lig2 \|.\|.\|.\| lign \fR[" 0 \fR]
382 .IR lig2 ", \|.\|.\|., " lign
383 are ligatures; possible ligatures are
391 For backwards compatibility, the list of ligatures may be terminated
395 The list of ligatures may not extend over more than one line.
399 The name of the font is\~\c
404 The glyphs of the font have a slant of
408 (Positive means forward.)
412 The normal width of a space is\~\c
419 this means that when a glyph is requested that is not present in
420 the current font, it is searched for in any special fonts that are
424 Other commands are ignored by
426 but may be used by postprocessors to store arbitrary information
427 about the font in the font file.
430 The first section can contain comments which start with the
432 character and extend to the end of a line.
435 The second section contains one or two subsections.
440 and it may also contain a
444 These subsections can appear in any order.
446 Each subsection starts with a word on a line by itself.
451 starts the charset subsection.
455 line is followed by a sequence of lines.
457 Each line gives information for one glyph.
459 A line comprises a number of fields separated
465 .I name metrics type code
472 identifies the glyph:
477 then it corresponds to the groff input character
481 where c is a single character, then it
482 corresponds to the special character
484 otherwise it corresponds to the groff input character
485 .BI \[rs][ name ]\fR.
487 If it is exactly two characters
492 Note that single-letter special characters can't be accessed as
494 the only exception is \[oq]\[rs]\-\[cq] which is identical to
499 is special and indicates that the glyph is unnamed;
500 such glyphs can only be used by means of the
508 field gives the glyph type:
512 means the glyph has a descender, for example, \[oq]p\[cq];
516 means the glyph has an ascender, for example, \[oq]b\[cq];
520 means the glyph has both an ascender and a descender, for example,
526 field gives the code which the postprocessor uses to print the glyph.
528 The glyph can also be input to groff using this code by means of the
532 The code can be any integer.
534 If it starts with a\~\c
536 it is interpreted as octal;
541 it is interpreted as hexadecimal.
543 Note, however, that the
545 escape sequence only accepts a decimal integer.
550 field gives an ASCII string identifying the glyph which the
551 postprocessor uses to print that glyph.
553 This field is optional and is currently used by
555 to build sub-encoding arrays for PS fonts containing more than 256
558 (It has also been used for
560 entity names but for efficiency reasons this data is now compiled
565 Anything on the line after the encoding field or \[oq]\-\-\[cq] are
571 field has the form (in one line; it is broken here for the sake of
578 .RI [\fB, italic-correction
580 .RI [\fB, left-italic-correction\/\c
581 .RI [\fB, subscript-correction ]]]]]
584 There must not be any spaces between these subfields.
586 Missing subfields are assumed to be\~0.
588 The subfields are all decimal integers.
590 Since there is no associated binary format, these
591 values are not required to fit into a variable of type
593 as they are in ditroff.
597 subfields gives the width of the glyph.
601 subfield gives the height of the glyph (upwards is positive);
602 if a glyph does not extend above the baseline, it should be
603 given a zero height, rather than a negative height.
607 subfield gives the depth of the glyph, that is, the distance
608 below the baseline to which the glyph extends (downwards is positive);
609 if a glyph does not extend below the baseline, it should be
610 given a zero depth, rather than a negative depth.
614 subfield gives the amount of space that should be added after the
615 glyph when it is immediately to be followed by a glyph
619 .I left-italic-correction
620 subfield gives the amount of space that should be added before the
621 glyph when it is immediately to be preceded by a glyph
625 .I subscript-correction
626 gives the amount of space that should be added after a glyph
627 before adding a subscript.
629 This should be less than the italic correction.
632 A line in the charset section can also have the format
640 is just another name for the glyph mentioned in the
646 starts the kernpairs section.
648 This contains a sequence of lines of the form:
654 This means that when glyph
656 appears next to glyph
658 the space between them should be increased by\~\c
661 Most entries in kernpairs section have a negative value for\~\c
665 .\" ====================================================================
667 .\" ====================================================================
670 .IR @FONTDIR@/dev name /DESC
671 Device description file for device
675 .IR @FONTDIR@/dev name / F
676 Font file for font\~\c
682 .\" ====================================================================
684 .\" ====================================================================
686 .BR groff_out (@MAN5EXT@),
687 .BR @g@troff (@MAN1EXT@),
688 .BR addftinfo (@MAN1EXT@),
689 .BR afmtodit (@MAN1EXT@)
693 .\" XXX: Why is this paragraph _here_, of all places?
698 can be viewed either with
706 .BI groffer " n name"
708 for graphical mode (default is PDF mode).
711 .\" Restore compatibility mode (for, e.g., Solaris 10/11).
715 .\" ====================================================================
717 .\" ====================================================================
723 .\" vim: set filetype=groff textwidth=72: