groff_font.man revision 69626
1.ig \"-*- nroff -*- 2Copyright (C) 1989-1995 Free Software Foundation, Inc. 3 4Permission is granted to make and distribute verbatim copies of 5this manual provided the copyright notice and this permission notice 6are preserved on all copies. 7 8Permission is granted to copy and distribute modified versions of this 9manual under the conditions for verbatim copying, provided that the 10entire resulting derived work is distributed under the terms of a 11permission notice identical to this one. 12 13Permission is granted to copy and distribute translations of this 14manual into another language, under the above conditions for modified 15versions, except that this permission notice may be included in 16translations approved by the Free Software Foundation instead of in 17the original English. 18.. 19.de TQ 20.br 21.ns 22.TP \\$1 23.. 24.\" Like TP, but if specified indent is more than half 25.\" the current line-length - indent, use the default indent. 26.de Tp 27.ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP 28.el .TP "\\$1" 29.. 30.TH GROFF_FONT @MAN5EXT@ "@MDATE@" "Groff Version @VERSION@" 31.SH NAME 32groff_font \- format of groff device and font description files 33.SH DESCRIPTION 34The groff font format is roughly a superset of the ditroff 35font format. 36Unlike the ditroff font format, there is no associated binary 37format. 38The font files for device 39.I name 40are stored in a directory 41.BI dev name. 42There are two types of file: a 43device description file called 44.B DESC 45and for each font 46.I F 47a font file called 48.IR F . 49These are text files; 50there is no associated binary format. 51.SS DESC file format 52The DESC file can contain the following types of line: 53.TP 54.BI res\ n 55There are 56.I n 57machine units per inch. 58.TP 59.BI hor\ n 60The horizontal resolution is 61.I n 62machine units. 63.TP 64.BI vert\ n 65The vertical resolution is 66.I n 67machine units. 68.TP 69.BI sizescale\ n 70The scale factor for pointsizes. 71By default this has a value of 1. 72One 73.I 74scaled point 75is equal to 76one 77.RI point/ n . 78The arguments to the 79.B unitwidth 80and 81.B sizes 82commands are given in scaled points. 83.TP 84.BI unitwidth\ n 85Quantities in the font files are given in machine units 86for fonts whose point size is 87.I n 88scaled points. 89.TP 90.B tcommand 91This means that the postprocessor can handle the 92.B t 93and 94.B u 95output commands. 96.TP 97.BI sizes\ s1\ s2\|.\|.\|.\|sn\ 0 98This means that the device has fonts at 99.IR s1 , 100.IR s2 ,\|.\|.\|.\| sn 101scaled points. 102The list of sizes must be terminated by a 103.BR 0 . 104Each 105.BI s i 106can also be a range of sizes 107.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 use_charnames_in_special 134This command indicates that troff should encode named characters inside 135special commands. 136.TP 137.B pass_filenames 138requests that troff tells the driver the source file name being processed. 139This is achieved by another tcommand: 140.B F 141.IR filename . 142.TP 143.B charset 144This line and everything following in the file are ignored. 145It is allowed for the sake of backwards compatibility. 146.LP 147The res, unitwidth, fonts and sizes lines are compulsory. 148Other commands are ignored by 149.B troff 150but may be used by postprocessors to store arbitrary information 151about the device in the DESC file. 152.LP 153Here a list of obsolete keywords which are recognized by 154.B groff 155but completely ignored: 156.BR spare1 , 157.BR spare2 , 158.BR biggestfont . 159.SS Font file format 160A font file has two sections. The first section is a sequence 161of lines each containing a sequence of blank delimited 162words; the first word in the line is a key, and subsequent 163words give a value for that key. 164.TP 165.BI name\ F 166The name of the font is 167.IR F . 168.TP 169.BI spacewidth\ n 170The normal width of a space is 171.IR n . 172.TP 173.BI slant\ n 174The characters of the font have a slant of 175.I n 176degrees. (Positive means forward.) 177.TP 178.BI ligatures\ lig1\ lig2\|.\|.\|.\|lign\ \fR[ 0 \fR] 179Characters 180.IR lig1 , 181.IR lig2 ,\|.\|.\|., lign 182are ligatures; possible ligatures are 183.BR ff , 184.BR fi , 185.BR fl , 186.B ffi 187and 188.BR ffl . 189For backwards compatibility, the list of ligatures may be terminated 190with a 191.BR 0. 192The list of ligatures may not extend over more than one line. 193.TP 194.B special 195The font is 196.IR special ; 197this means that when a character is requested that is not present in 198the current font, it will be searched for in any special fonts that 199are mounted. 200.LP 201Other commands are ignored by 202.B troff 203but may be used by postprocessors to store arbitrary information 204about the font in the font file. 205.LP 206The first section can contain comments which start with the 207.B # 208character and extend to the end of a line. 209.LP 210The second section contains one or two subsections. 211It must contain a 212.I charset 213subsection 214and it may also contain a 215.I kernpairs 216subsection. 217These subsections can appear in any order. 218Each subsection starts with a word on a line by itself. 219.LP 220The word 221.B charset 222starts the charset subsection. 223The 224.B charset 225line is followed by a sequence of lines. 226Each line gives information for one character. 227A line comprises a number of fields separated 228by blanks or tabs. The format is 229.IP 230.I name metrics type code 231.RI [ entity_name ] 232.RB [ -- 233.IR comment ] 234.LP 235.I name 236identifies the character: 237if 238.I name 239is a single character 240.I c 241then it corresponds to the groff input character 242.IR c ; 243if it is of the form 244.BI \e c 245where c is a single character, then it 246corresponds to the groff input character 247.BI \e c\fR; 248otherwise it corresponds to the groff input character 249.BI \e[ name ] 250(if it is exactly two characters 251.I xx 252it can be entered as 253.BI \e( xx\fR.) 254Groff supports eight bit characters; however some utilities 255has difficulties with eight bit characters. 256For this reason, there is a convention that the name 257.BI char n 258is equivalent to the single character whose code is 259.I n . 260For example, 261.B char163 262would be equivalent to the character with code 163 263which is the pounds sterling sign in ISO Latin-1. 264The name 265.B \-\-\- 266is special and indicates that the character is unnamed; 267such characters can only be used by means of the 268.B \eN 269escape sequence in 270.BR troff . 271.LP 272The 273.I type 274field gives the character type: 275.TP 2761 277means the character has an descender, for example, p; 278.TP 2792 280means the character has an ascender, for example, b; 281.TP 2823 283means the character has both an ascender and a descender, for example, 284(. 285.LP 286The 287.I code 288field gives the code which the postprocessor uses to print the character. 289The character can also be input to groff using this code by means of the 290.B \eN 291escape sequence. 292The code can be any integer. 293If it starts with a 294.B 0 295it will be interpreted as octal; 296if it starts with 297.B 0x 298or 299.B 0X 300it will be intepreted as hexadecimal. 301.LP 302The 303.I entity_name 304field gives an ascii string identifying the glyph which the postprocessor 305uses to print the character. 306This field is optional and has been introduced so that the html device driver 307can encode its character set. 308For example, the character `\e[Po]' is represented as `£' in html 4.0. 309.LP 310Anything on the line after the encoding field resp. after `-\&-' will 311be ignored. 312.LP 313The 314.I metrics 315field has the form: 316.IP 317.IR width [\fB, height [\fB, depth [\fB, italic_correction [\fB, \ 318left_italic_correction [\fB, subscript_correction ]]]]] 319.LP 320There must not be any spaces between these subfields. 321Missing subfields are assumed to be 0. 322The subfields are all decimal integers. 323Since there is no associated binary format, these 324values are not required to fit into a variable of type 325.B char 326as they are in ditroff. 327The 328.I width 329subfields gives the width of the character. 330The 331.I height 332subfield gives the height of the character (upwards is positive); 333if a character does not extend above the baseline, it should be 334given a zero height, rather than a negative height. 335The 336.I depth 337subfield gives the depth of the character, that is, the distance 338below the lowest point below the baseline to which the 339character extends (downwards is positive); 340if a character does not extend below above the baseline, it should be 341given a zero depth, rather than a negative depth. 342The 343.I italic_correction 344subfield gives the amount of space that should be added after the 345character when it is immediately to be followed by a character 346from a roman font. 347The 348.I left_italic_correction 349subfield gives the amount of space that should be added before the 350character when it is immediately to be preceded by a character 351from a roman font. 352The 353.I subscript_correction 354gives the amount of space that should be added after a character 355before adding a subscript. 356This should be less than the italic correction. 357.LP 358A line in the charset section can also have the format 359.IP 360.I 361name \fB" 362.LP 363This indicates that 364.I name 365is just another name for the character mentioned in the 366preceding line. 367.LP 368The word 369.B kernpairs 370starts the kernpairs section. 371This contains a sequence of lines of the form: 372.IP 373.I 374c1 c2 n 375.LP 376This means that when character 377.I c1 378appears next to character 379.I c2 380the space between them should be increased by 381.IR n . 382Most entries in kernpairs section will have a negative value for 383.IR n . 384.SH FILES 385.Tp \w'@FONTDIR@/devname/DESC'u+3n 386.BI @FONTDIR@/dev name /DESC 387Device description file for device 388.IR name . 389.TP 390.BI @FONTDIR@/dev name / F 391Font file for font 392.I F 393of device 394.IR name . 395.SH "SEE ALSO" 396.BR groff_out (@MAN5EXT@), 397.BR @g@troff (@MAN1EXT@). 398