Merge branch 'topic/sync-to-go-2'
[s-roff.git] / man / l_roff-font.5.in
blob51da6ee537194e76165d1e4acfeb05d34ffebd48
1 .ig
2 @ @L_ROFF@-font.5
4 Copyright (c) 2014 - 2017 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
6 Copyright (C) 1989 - 1995, 2001 - 2004, 2006 - 2008
7   Free Software Foundation, Inc.
9 Permission is granted to make and distribute verbatim copies of
10 this manual provided the copyright notice and this permission notice
11 are preserved on all copies.
13 Permission is granted to copy and distribute modified versions of this
14 manual under the conditions for verbatim copying, provided that the
15 entire resulting derived work is distributed under the terms of a
16 permission notice identical to this one.
18 Permission is granted to copy and distribute translations of this
19 manual into another language, under the above conditions for modified
20 versions, except that this permission notice may be included in
21 translations approved by the Free Software Foundation instead of in
22 the original English.
25 .do nr roff_font_C \n[.C]
26 .cp 0
29 .\" Like TP, but if specified indent is more than half
30 .\" the current line-length - indent, use the default indent.
31 .de Tp
32 .  ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
33 .  el .TP "\\$1"
37 .TH @U_ROFF@-FONT @MAN5EXT@ "@MDATE@" "@T_ROFF@ v@VERSION@"
40 .SH NAME
41 @L_ROFF@-font \- format of @T_ROFF@ device and font description files
44 .SH DESCRIPTION
45 The font format is roughly a superset of the ditroff font format.
47 The font files for device
48 .I name
49 are stored in a directory
50 .BI dev name\c
51 \&.
53 There are two types of file: a
54 device description file called
55 .B DESC
56 and for each font\~\c
57 .I F
58 a font file called\~\c
59 .IR F .
61 These are text files;
62 unlike the ditroff font format,
63 there is no associated binary format.
66 .SS DESC file format
68 The DESC file can contain the following types of line as shown below.
70 Later entries in the file override previous values.
72 .LP
73 Empty lines are ignored.
75 .TP
76 .B charset
77 This line and everything following in the file are ignored.
79 It is allowed for the sake of backwards compatibility.
81 .TP
82 .BI family\  fam
83 The default font family is
84 .IR fam .
86 .TP
87 .BI fonts\  n\ F1\ F2\ F3\ \|.\|.\|.\|\ Fn
88 Fonts
89 .IR F1 ,\ \|.\|.\|.,\  Fn
90 are mounted in the font positions
91 .IR m \|+\|1,\ \|.\|.\|.,\  m \|+\| n
92 where
93 .I m
94 is the number of styles.
96 This command may extend over more than one line.
98 A font name of\~\c
99 .B 0
100 causes no font to be mounted on the corresponding font position.
103 .BI hor\  n
104 The horizontal resolution is
105 .IR n \~\c
106 machine units.
109 .BI image_generator\  string
110 Needed for
111 .B \%@L_D_HTML@
112 only.
114 It specifies the program to generate PNG images from
115 PostScript input.
117 Under GNU/Linux this is usually
118 .I gs
119 but under other systems (notably cygwin) it might be set to another name.
122 .BI paperlength\  n
123 The physical vertical dimension of the output medium in machine units.
125 This isn't used by
126 .B troff
127 itself but by output devices.
129 Deprecated.
132 .B papersize
133 instead.
136 .BI papersize\  string
137 Select a paper size.
139 Valid values for
140 .I string
141 are the ISO paper types A0-A7, B0-B7, C0-C7, D0-D7, DL, and the US paper
142 types letter, legal, tabloid, ledger, statement, executive, com10, and
143 monarch.
145 Case is not significant for
146 .IR string
147 if it holds predefined paper types.
149 Alternatively,
150 .I string
151 can be a file name (e.g.\& `/etc/papersize'); if the file can be opened,
152 the first line is read and tested for the above paper sizes.
154 Finally,
155 .I string
156 can be a custom paper size in the format
157 .IB length , width
158 (no spaces before and after the comma).
160 Both
161 .I length
163 .I width
164 must have a unit appended; valid values are `i' for inches, `c' for
165 centimeters, `p' for points, and `P' for picas.
167 Example:
168 .BR 12c,235p .
170 An argument which starts with a digit is always treated as a custom paper
171 format.
173 .B papersize
174 sets both the vertical and horizontal dimension of the output medium.
177 More than one argument can be specified, in which case they will be
178 scanned from left to right and the first valid paper specification is used.
181 .BI paperwidth\  n
182 The physical horizontal dimension of the output medium in machine units.
184 Deprecated.
187 .B papersize
188 instead.
190 This isn't used by
191 .BR troff
192 itself but by output devices.
195 .B pass_filenames
196 Make troff tell the driver the source file name being processed.
198 This is achieved by another tcommand:
199 .BR F \~\c
200 .IR filename .
203 .BI postpro\  program
205 .I program
206 as the postprocessor.
209 .BI prepro\  program
210 Call
211 .I program
212 as a preprocessor.
215 .BI print\  program
217 .I program
218 as the spooler program for printing.
220 If omitted, the
221 .B \-l
223 .B \-L
224 options of
225 .B @L_ROFF@
226 are ignored.
229 .BI res\  n
230 There are
231 .I n
232 machine units per inch.
235 .BI sizes\  s1\ s2\ \|.\|.\|.\|\ sn\  0
236 This means that the device has fonts at
237 .IR s1 ,
238 .IR s2 ,\ \|.\|.\|.,\  sn
239 scaled points.
241 The list of sizes must be terminated by a
242 .BR 0 .
244 Each
245 .I si
246 can also be a range of sizes
247 .IR m \- n .
249 The list can extend over more than one line.
252 .BI sizescale\  n
253 The scale factor for point sizes.
255 By default this has a value of 1.
259 scaled point
260 is equal to
262 .RI point\|/\| n .
264 The arguments to the
265 .B unitwidth
267 .B sizes
268 commands are given in scaled points.
271 .BI styles\  S1\ S2\ \|.\|.\|.\|\ Sm
272 The first
273 .I m
274 font positions are associated with styles
275 .IR S1 ,\ \|.\|.\|.,\  Sm .
278 .B tcommand
279 This means that the postprocessor can handle the
280 .B t
281 and\~\c
282 .B u
283 output commands.
286 .B unicode
287 Indicate that the output device supports the complete Unicode
288 repertoire.
290 Useful only for devices which produce
291 .I character entities
292 instead of glyphs.
296 .B unicode
297 is present, no
298 .B charset
299 section is required in the font description files since the Unicode
300 handling built into
301 .B @L_ROFF@
302 is used.
304 However, if there are entries in a
305 .B charset
306 section, they either override the default mappings for those
307 particular characters or add new mappings (normally for composite
308 characters).
311 This is used for
312 .BR \-Tutf8 ,
313 .BR \-Thtml ,
315 .BR \-Txhtml .
318 .BI unitwidth\  n
319 Quantities in the font files are given in machine units
320 for fonts whose point size is
321 .IR n \~\c
322 scaled points.
325 .B unscaled_charwidths
326 Make the font handling module always return unscaled glyph widths.
328 Needed for the
329 .B \%@L_D_HTML@
330 device.
333 .B use_charnames_in_special
334 This command indicates that troff should encode named glyphs inside
335 special commands.
338 .BI vert\  n
339 The vertical resolution is
340 .IR n \~\c
341 machine units.
345 .BR res ,
346 .BR unitwidth ,
347 .BR fonts ,
349 .B sizes
350 lines are compulsory.
352 Not all commands in the DESC file are used by
353 .B troff
354 itself; some of the keywords (or even additional ones) are used by
355 postprocessors to store arbitrary information about the device.
358 Here a list of obsolete keywords which are recognized by
359 .B @L_ROFF@
360 but completely ignored:
361 .BR spare1 ,
362 .BR spare2 ,
363 .BR biggestfont .
366 .SS Font file format
368 A font file has two sections;
369 empty lines are ignored in both of them.
372 The first section is a sequence
373 of lines each containing a sequence of blank delimited
374 words; the first word in the line is a key, and subsequent
375 words give a value for that key.
378 .BI ligatures\  lig1\ lig2\ \|.\|.\|.\|\ lign\ \fR[ 0 \fR]
379 Glyphs
380 .IR lig1 ,
381 .IR lig2 ,\ \|.\|.\|.,\  lign
382 are ligatures; possible ligatures are
383 .BR ff ,
384 .BR fi ,
385 .BR fl ,
386 .BR ffi ,
388 .BR ffl .
390 For backwards compatibility, the list of ligatures may be terminated
391 with a\~\c
392 .BR 0.
394 The list of ligatures may not extend over more than one line.
397 .BI name\  F
398 The name of the font is\~\c
399 .IR F .
402 .BI slant\  n
403 The glyphs of the font have a slant of
404 .IR n \~\c
405 degrees.
407 (Positive means forward.)
410 .BI spacewidth\  n
411 The normal width of a space is\~\c
412 .IR n .
415 .B special
416 The font is
417 .IR special ;
418 this means that when a glyph is requested that is not present in
419 the current font, it is searched for in any special fonts that are
420 mounted.
423 Other commands are ignored by
424 .B troff
425 but may be used by postprocessors to store arbitrary information
426 about the font in the font file.
429 The first section can contain comments which start with the
430 .B #
431 character and extend to the end of a line.
434 The second section contains one or two subsections.
436 It must contain a
437 .I charset
438 subsection
439 and it may also contain a
440 .I kernpairs
441 subsection.
443 These subsections can appear in any order.
445 Each subsection starts with a word on a line by itself.
448 The word
449 .B charset
450 starts the charset subsection.
453 .B charset
454 line is followed by a sequence of lines.
456 Each line gives information for one glyph.
458 A line comprises a number of fields separated
459 by blanks or tabs.
461 The format is
464 .I name metrics type code
465 .RI [ entity_name ]
466 .RB [ \-\-
467 .IR comment ]
470 .I name
471 identifies the glyph:
473 .I name
474 is a single glyph
475 .I c
476 then it corresponds to the input character
477 .IR c ;
478 if it is of the form
479 .BI \[rs] c
480 where c is a single character, then it
481 corresponds to the special character
482 .BI \[rs][ c ]\fR;
483 otherwise it corresponds to the input character
484 .BI \[rs][ name ]\fR.
486 If it is exactly two characters
487 .I xx
488 it can be entered as
489 .BI \[rs]( xx\fR.
491 Note that single-letter special characters can't be accessed as
492 .BI \[rs] c\fR;
493 the only exception is `\[rs]\-' which is identical to `\[rs][\-]'.
495 The name
496 .B \-\-\-
497 is special and indicates that the glyph is unnamed;
498 such glyphs can only be used by means of the
499 .B \[rs]N
500 escape sequence in
501 .BR troff .
505 .I type
506 field gives the glyph type:
510 means the glyph has a descender, for example, `p';
514 means the glyph has an ascender, for example, `b';
518 means the glyph has both an ascender and a descender, for example,
519 `('.
523 .I code
524 field gives the code which the postprocessor uses to print the glyph.
526 The glyph can also be input using this code by means of the
527 .B \[rs]N
528 escape sequence.
530 The code can be any integer.
532 If it starts with a\~\c
533 .B 0
534 it is interpreted as octal;
535 if it starts with
536 .B 0x
538 .B 0X
539 it is intepreted as hexadecimal.
541 Note, however, that the
542 .B \[rs]N
543 escape sequence only accepts a decimal integer.
547 .I entity_name
548 field gives an ASCII string identifying the glyph which the postprocessor
549 uses to print that glyph.
551 This field is optional and is currently used by
552 .B @L_D_PS@
553 to build sub-encoding arrays for PS fonts containing more than 256 glyphs.
555 (It has also been used for
556 .BR \%@L_D_HTML@ 's
557 entity names but for efficiency reasons this data is now compiled directly
558 into
559 .BR \%@L_D_HTML@ .)
562 Anything on the line after the encoding field or `\-\-' are ignored.
566 .I metrics
567 field has the form (in one line; it is broken here for the sake of
568 readability):
571 .I width\c
572 .RI [\fB, height\c
573 .RI [\fB, depth\c
574 .RI [\fB, italic-correction
576 .RI [\fB, left-italic-correction\c
577 .RI [\fB, subscript-correction ]]]]]
580 There must not be any spaces between these subfields.
582 Missing subfields are assumed to be\~0.
584 The subfields are all decimal integers.
586 Since there is no associated binary format, these
587 values are not required to fit into a variable of type
588 .B char
589 as they are in ditroff.
592 .I width
593 subfields gives the width of the glyph.
596 .I height
597 subfield gives the height of the glyph (upwards is positive);
598 if a glyph does not extend above the baseline, it should be
599 given a zero height, rather than a negative height.
602 .I depth
603 subfield gives the depth of the glyph, that is, the distance
604 below the lowest point below the baseline to which the
605 glyph extends (downwards is positive);
606 if a glyph does not extend below above the baseline, it should be
607 given a zero depth, rather than a negative depth.
610 .I italic-correction
611 subfield gives the amount of space that should be added after the
612 glyph when it is immediately to be followed by a glyph
613 from a roman font.
616 .I left-italic-correction
617 subfield gives the amount of space that should be added before the
618 glyph when it is immediately to be preceded by a glyph
619 from a roman font.
622 .I subscript-correction
623 gives the amount of space that should be added after a glyph
624 before adding a subscript.
626 This should be less than the italic correction.
629 A line in the charset section can also have the format
633 name \fB"
636 This indicates that
637 .I name
638 is just another name for the glyph mentioned in the
639 preceding line.
642 The word
643 .B kernpairs
644 starts the kernpairs section.
646 This contains a sequence of lines of the form:
649 .I c1 c2 n
652 This means that when glyph
653 .I c1
654 appears next to glyph
655 .I c2
656 the space between them should be increased by\~\c
657 .IR n .
659 Most entries in kernpairs section have a negative value for\~\c
660 .IR n .
663 .SH FILES
665 .Tp \w'@FONTDIR@/dev-name/DESC'u+3n
666 .B @FONTDIR@/dev-name/DESC
667 Device description file for device
668 .IR name .
671 .B @FONTDIR@/dev-name/F
672 Font file for font\~\c
673 .I F
674 of device
675 .IR name .
678 .SH "SEE ALSO"
680 .BR @L_ROFF@-out (@MAN5EXT@),
681 .BR @L_TROFF@ (@MAN1EXT@).
683 .cp \n[roff_font_C]
685 .\" s-ts-mode