1 .\" Emacs mode: -*- nroff -*-
2 .TH GROFF_FONT @MAN5EXT@ "@MDATE@" "Groff Version @VERSION@"
4 groff_font \- format of groff device and font description files
7 .\" --------------------------------------------------------------------
9 .\" --------------------------------------------------------------------
12 Copyright \(co 1989\-2014 Free Software Foundation, Inc.
14 This file is part of groff (GNU roff), which is a free software project.
16 You can redistribute it and/or modify it under the terms of the GNU
17 General Public License as published by the Free Software Foundation,
18 either version 2 of the License, or (at your option) any later
21 You should have received a copy of the GNU General Public License
22 along with this program. If not, see
23 .UR http://www.gnu.org/licenses/gpl-2.0.html
28 .\" --------------------------------------------------------------------
30 .\" --------------------------------------------------------------------
32 .do nr groff_font_C \n[.C]
36 .\" Like TP, but if specified indent is more than half
37 .\" the current line-length - indent, use the default indent.
39 . ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
43 .\" --------------------------------------------------------------------
45 .\" --------------------------------------------------------------------
47 The groff font format is roughly a superset of the ditroff
50 The font files for device
52 are stored in a directory
56 There are two types of file: a device description file called
60 a font file called\~\c
64 unlike the ditroff font format,
65 there is no associated binary format.
68 .\" --------------------------------------------------------------------
70 .\" --------------------------------------------------------------------
72 The DESC file can contain the following types of line as shown below.
74 Later entries in the file override previous values.
77 Empty lines are ignored.
81 This line and everything following in the file are ignored.
83 It is allowed for the sake of backwards compatibility.
87 The default font family is
91 .BI "fonts " "n F1 F2 F3 \|.\|.\|.\| Fn"
93 .IR F1 ", \|.\|.\|., " Fn
94 are mounted in the font positions
95 .IR m "\|+\|1, \|.\|.\|., " m \|+\| n
98 is the number of styles.
100 This command may extend over more than one line.
104 causes no font to be mounted on the corresponding font position.
108 The horizontal resolution is
113 .BI "image_generator " string
118 It specifies the program to generate PNG images from
121 Under GNU/Linux this is usually
123 but under other systems (notably cygwin) it might be set to another name.
127 The physical vertical dimension of the output medium in machine units.
129 This isn\[aq]t used by
131 itself but by output devices.
140 .BI "papersize " string
145 are the ISO paper types A0\[en]A7, B0\[en]B7, C0\[en]C7, D0\[en]D7,
147 types letter, legal, tabloid, ledger, statement, executive, com10, and
150 Case is not significant for
152 if it holds predefined paper types.
156 can be a file name (e.g.\& \[oq]/etc/papersize\[cq]); if the file can
159 reads the first line and tests for the above paper sizes.
163 can be a custom paper size in the format
165 (no spaces before and after the comma).
171 must have a unit appended; valid values are \[oq]i\[cq] for inches,
172 \[oq]c\[cq] for centimeters, \[oq]p\[cq] for points, and \[oq]P\[cq]
178 An argument which starts with a digit is always treated as a custom paper
182 sets both the vertical and horizontal dimension of the output medium.
185 More than one argument can be specified;
187 scans from left to right and uses the first valid paper specification.
191 The physical horizontal dimension of the output medium in machine units.
199 This isn\[aq]t used by
201 itself but by output devices.
205 Make troff tell the driver the source file name being processed.
207 This is achieved by another tcommand:
212 .BI "postpro " program
215 as the postprocessor.
218 .BI "prepro " program
227 as the spooler program for printing.
241 machine units per inch.
244 .BI "sizes " "s1 s2 \|.\|.\|.\| sn " 0
245 This means that the device has fonts at
247 .IR s2 ", \|.\|.\|., " sn
250 The list of sizes must be terminated by a
255 can also be a range of sizes
258 The list can extend over more than one line.
262 The scale factor for point sizes.
264 By default this has a value of 1.
277 commands are given in scaled points.
280 .BI "styles " "S1 S2 \|.\|.\|.\| Sm"
283 font positions are associated with styles
284 .IR S1 ", \|.\|.\|., " Sm .
288 This means that the postprocessor can handle the
296 Indicate that the output device supports the complete Unicode
299 Useful only for devices which produce
300 .I character entities
308 section is required in the font description files since the Unicode
313 However, if there are entries in a
315 section, they either override the default mappings for those
316 particular characters or add new mappings (normally for composite
328 Quantities in the font files are given in machine units
329 for fonts whose point size is
334 .B unscaled_charwidths
335 Make the font handling module always return unscaled glyph widths.
342 .B use_charnames_in_special
343 This command indicates that troff should encode named glyphs inside
348 The vertical resolution is
359 lines are compulsory.
361 Not all commands in the DESC file are used by
363 itself; some of the keywords (or even additional ones) are used by
364 postprocessors to store arbitrary information about the device.
367 Here a list of obsolete keywords which are recognized by
369 but completely ignored:
375 .\" --------------------------------------------------------------------
377 .\" --------------------------------------------------------------------
379 A font file has two sections; empty lines are ignored in both of them.
382 The first section is a sequence of lines each containing a sequence of
383 blank delimited words; the first word in the line is a key, and
384 subsequent words give a value for that key.
387 .BI "ligatures " "lig1 lig2 \|.\|.\|.\| lign \fR[" 0 \fR]
390 .IR lig2 ", \|.\|.\|., " lign
391 are ligatures; possible ligatures are
399 For backwards compatibility, the list of ligatures may be terminated
403 The list of ligatures may not extend over more than one line.
407 The name of the font is\~\c
412 The glyphs of the font have a slant of
416 (Positive means forward.)
420 The normal width of a space is\~\c
427 this means that when a glyph is requested that is not present in
428 the current font, it is searched for in any special fonts that are
432 Other commands are ignored by
434 but may be used by postprocessors to store arbitrary information
435 about the font in the font file.
438 The first section can contain comments which start with the
440 character and extend to the end of a line.
443 The second section contains one or two subsections.
448 and it may also contain a
452 These subsections can appear in any order.
454 Each subsection starts with a word on a line by itself.
459 starts the charset subsection.
463 line is followed by a sequence of lines.
465 Each line gives information for one glyph.
467 A line comprises a number of fields separated
473 .I name metrics type code
480 identifies the glyph:
485 then it corresponds to the groff input character
489 where c is a single character, then it
490 corresponds to the special character
492 otherwise it corresponds to the groff input character
493 .BI \[rs][ name ]\fR.
495 If it is exactly two characters
500 Note that single-letter special characters can\[aq]t be accessed as
502 the only exception is \[oq]\[rs]\-\[cq] which is identical to
507 is special and indicates that the glyph is unnamed;
508 such glyphs can only be used by means of the
516 field gives the glyph type:
520 means the glyph has a descender, for example, \[oq]p\[cq];
524 means the glyph has an ascender, for example, \[oq]b\[cq];
528 means the glyph has both an ascender and a descender, for example,
534 field gives the code which the postprocessor uses to print the glyph.
536 The glyph can also be input to groff using this code by means of the
540 The code can be any integer.
542 If it starts with a\~\c
544 it is interpreted as octal;
549 it is interpreted as hexadecimal.
551 Note, however, that the
553 escape sequence only accepts a decimal integer.
558 field gives an ASCII string identifying the glyph which the
559 postprocessor uses to print that glyph.
561 This field is optional and is currently used by
563 to build sub-encoding arrays for PS fonts containing more than 256
566 (It has also been used for
568 entity names but for efficiency reasons this data is now compiled
573 Anything on the line after the encoding field or \[oq]\-\-\[cq] are
579 field has the form (in one line; it is broken here for the sake of
586 .RI [\fB, italic-correction
588 .RI [\fB, left-italic-correction\c
589 .RI [\fB, subscript-correction ]]]]]
592 There must not be any spaces between these subfields.
594 Missing subfields are assumed to be\~0.
596 The subfields are all decimal integers.
598 Since there is no associated binary format, these
599 values are not required to fit into a variable of type
601 as they are in ditroff.
605 subfields gives the width of the glyph.
609 subfield gives the height of the glyph (upwards is positive);
610 if a glyph does not extend above the baseline, it should be
611 given a zero height, rather than a negative height.
615 subfield gives the depth of the glyph, that is, the distance
616 below the lowest point below the baseline to which the
617 glyph extends (downwards is positive);
618 if a glyph does not extend below above the baseline, it should be
619 given a zero depth, rather than a negative depth.
623 subfield gives the amount of space that should be added after the
624 glyph when it is immediately to be followed by a glyph
628 .I left-italic-correction
629 subfield gives the amount of space that should be added before the
630 glyph when it is immediately to be preceded by a glyph
634 .I subscript-correction
635 gives the amount of space that should be added after a glyph
636 before adding a subscript.
638 This should be less than the italic correction.
641 A line in the charset section can also have the format
649 is just another name for the glyph mentioned in the
655 starts the kernpairs section.
657 This contains a sequence of lines of the form:
663 This means that when glyph
665 appears next to glyph
667 the space between them should be increased by\~\c
670 Most entries in kernpairs section have a negative value for\~\c
674 .\" --------------------------------------------------------------------
676 .\" --------------------------------------------------------------------
678 .Tp \w'@FONTDIR@/devname/DESC'u+3n
679 .BI @FONTDIR@/dev name /DESC
680 Device description file for device
684 .BI @FONTDIR@/dev name / F
685 Font file for font\~\c
691 .\" --------------------------------------------------------------------
693 .\" --------------------------------------------------------------------
695 .BR groff_out (@MAN5EXT@),
696 .BR @g@troff (@MAN1EXT@),
697 .BR addftinfo (@MAN1EXT@),
698 .BR afmtodit (@MAN1EXT@)
706 can be viewed either with
714 .BI "groffer " n name"
716 for graphical mode (default is PDF mode).
720 .\" --------------------------------------------------------------------
722 .\" --------------------------------------------------------------------