groff_font.man revision 151497
10SN/A.ig
23294SalanbCopyright (C) 1989-1995, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
30SN/A
40SN/APermission is granted to make and distribute verbatim copies of
50SN/Athis manual provided the copyright notice and this permission notice
60SN/Aare preserved on all copies.
70SN/A
80SN/APermission is granted to copy and distribute modified versions of this
90SN/Amanual under the conditions for verbatim copying, provided that the
100SN/Aentire resulting derived work is distributed under the terms of a
110SN/Apermission notice identical to this one.
120SN/A
130SN/APermission is granted to copy and distribute translations of this
140SN/Amanual into another language, under the above conditions for modified
150SN/Aversions, except that this permission notice may be included in
160SN/Atranslations approved by the Free Software Foundation instead of in
170SN/Athe original English.
180SN/A..
19553SN/A.
20553SN/A.do nr groff_font_C \n[.C]
21553SN/A.cp 0
220SN/A.
230SN/A.de TQ
240SN/A.  br
250SN/A.  ns
260SN/A.  TP \\$1
270SN/A..
280SN/A.
293294Salanb.\" Like TP, but if specified indent is more than half
300SN/A.\" the current line-length - indent, use the default indent.
310SN/A.de Tp
320SN/A.  ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
33709SN/A.  el .TP "\\$1"
343233Sksrini..
353233Sksrini.
363233Sksrini.
373233Sksrini.TH GROFF_FONT @MAN5EXT@ "@MDATE@" "Groff Version @VERSION@"
383233Sksrini.
390SN/A.
403233Sksrini.SH NAME
413233Sksrinigroff_font \- format of groff device and font description files
423233Sksrini.
433233Sksrini.
443786Sksrini.SH DESCRIPTION
450SN/AThe groff font format is roughly a superset of the ditroff
463233Sksrinifont format.
473233Sksrini.
483233SksriniThe font files for device
493233Sksrini.I name
503233Sksriniare stored in a directory
513233Sksrini.BI dev name\c
523233Sksrini\&.
533233Sksrini.
543233SksriniThere are two types of file: a
553233Sksrinidevice description file called
563233Sksrini.B DESC
573233Sksriniand for each font
583233Sksrini.I F
593233Sksrinia font file called
603233Sksrini.IR F .
613233Sksrini.
623233SksriniThese are text files;
633786Sksriniunlike the ditroff font format,
643233Sksrinithere is no associated binary format.
653233Sksrini.
663233Sksrini.
673233Sksrini.SS DESC file format
683233Sksrini.
693233SksriniThe DESC file can contain the following types of line as shown below.
703233Sksrini.
713233SksriniLater entries in the file override previous values.
723233Sksrini.
730SN/A.TP
740SN/A.B charset
753233SksriniThis line and everything following in the file are ignored.
760SN/A.
770SN/AIt is allowed for the sake of backwards compatibility.
780SN/A.
790SN/A.TP
800SN/A.BI family\  fam
810SN/AThe default font family is
820SN/A.IR fam .
830SN/A.
84709SN/A.TP
85709SN/A.BI fonts\  n\ F1\ F2\ F3\|.\|.\|.\|Fn
86709SN/AFonts
87709SN/A.I F1\|.\|.\|.\|Fn
88709SN/Awill be mounted in the font positions 
893233Sksrini.IR m +1,\|.\|.\|., m + n
900SN/Awhere
91709SN/A.I m
923233Sksriniis the number of styles.
933233Sksrini.
943233SksriniThis command may extend over more than one line.
953233Sksrini.
963233SksriniA font name of
973233Sksrini.B 0
98709SN/Awill cause no font to be mounted on the corresponding font position.
99709SN/A.
100709SN/A.TP
101709SN/A.BI hor\  n
102709SN/AThe horizontal resolution is
103709SN/A.I n
104709SN/Amachine units.
105709SN/A.
106709SN/A.TP
107709SN/A.BI image_generator\  string
108709SN/ANeeded for
109709SN/A.B grohtml
110709SN/Aonly.
111709SN/AIt specifies the program to generate PNG images from
112709SN/APostScript input.
113709SN/AUnder GNU/Linux this is usually
114709SN/A.I gs
115709SN/Abut under other systems (notably cygwin) it might be set to another name.
116709SN/A.
117709SN/A.TP
118709SN/A.BI paperlength\  n
119709SN/AThe physical vertical dimension of the output medium in machine units.
120709SN/A.
121709SN/AThis isn't used by
122709SN/A.B troff
123709SN/Aitself but by output devices.
124709SN/A.
125709SN/ADeprecated.
126709SN/A.
127709SN/AUse
128709SN/A.B papersize
129709SN/Ainstead.
1300SN/A.
1310SN/A.TP
1320SN/A.BI papersize\  string
1333233SksriniSelect a paper size.
1343233Sksrini.
1353233SksriniValid values for
1363233Sksrini.I string
1373233Sksriniare the ISO paper types A0-A7, B0-B7, C0-C7, D0-D7, DL, and the US paper
1383233Sksrinitypes letter, legal, tabloid, ledger, statement, executive, com10, and
1393233Sksrinimonarch.
1403233Sksrini.
1413233SksriniCase is not significant for
1423233Sksrini.IR string
1433233Sksriniif it holds predefined paper types.
1443233Sksrini.
1453233SksriniAlternatively,
1463233Sksrini.I string
1473233Sksrinican be a file name (e.g.\& `/etc/papersize'); if the file can be opened,
1483233Sksrini.B groff
1493233Sksrinireads the first line and tests for the above paper sizes.
1503233Sksrini.
1513233SksriniFinally,
1523233Sksrini.I string
1533233Sksrinican be a custom paper size in the format
1543233Sksrini.IB length , width
1553233Sksrini(no spaces before and after the comma).
1563233Sksrini.
1573233SksriniBoth
1583233Sksrini.I length
1593233Sksriniand
1603233Sksrini.I width
1613233Sksrinimust have a unit appended; valid values are `i' for inches, `c' for
1623233Sksrinicentimeters, `p' for points, and `P' for picas.
1630SN/A.
164Example:
165.BR 12c,235p .
166.
167An argument which starts with a digit is always treated as a custom paper
168format.
169.
170.B papersize
171sets both the vertical and horizontal dimension of the output medium.
172.
173.IP
174More than one argument can be specified;
175.B groff
176scans from left to right and uses the first valid paper specification.
177.
178.TP
179.BI paperwidth\  n
180The physical horizontal dimension of the output medium in machine units.
181.
182Deprecated.
183.
184Use
185.B papersize
186instead.
187.
188This isn't used by
189.BR troff
190itself but by output devices.
191.
192.TP
193.B pass_filenames
194Make troff tell the driver the source file name being processed.
195.
196This is achieved by another tcommand:
197.B F
198.IR filename .
199.
200.TP
201.BI postpro\  program
202Use
203.I program
204as the postprocessor.
205.
206.TP
207.BI prepro\  program
208Call
209.I program
210as a preprocessor.
211.
212.TP
213.BI print\  program
214Use
215.I program
216as the spooler program for printing.
217.
218If omitted, the
219.B \-l
220and
221.B \-L
222options of
223.B groff
224are ignored.
225.
226.TP
227.BI res\  n
228There are
229.I n
230machine units per inch.
231.
232.TP
233.BI sizes\  s1\ s2\|.\|.\|.\|sn\  0
234This means that the device has fonts at
235.IR s1 ,
236.IR s2 ,\|.\|.\|.\| sn
237scaled points.
238.
239The list of sizes must be terminated by a
240.BR 0 .
241.
242Each
243.I si
244can also be a range of sizes
245.IR m \- n .
246.
247The list can extend over more than one line.
248.
249.TP
250.BI sizescale\  n
251The scale factor for pointsizes.
252.
253By default this has a value of 1.
254.
255One
256.I
257scaled point
258is equal to
259one
260.RI point/ n .
261.
262The arguments to the
263.B unitwidth
264and
265.B sizes
266commands are given in scaled points.
267.
268.TP
269.BI styles\  S1\ S2\|.\|.\|.\|Sm
270The first
271.I m
272font positions will be associated with styles
273.IR S1\|.\|.\|.\|Sm .
274.
275.TP
276.B tcommand
277This means that the postprocessor can handle the
278.B t
279and
280.B u
281output commands.
282.
283.TP
284.BI unitwidth\  n
285Quantities in the font files are given in machine units
286for fonts whose point size is
287.I n 
288scaled points.
289.
290.TP
291.B unscaled_charwidths
292Make the font handling module always return unscaled character widths.
293Needed for the
294.B grohtml
295device.
296.
297.TP
298.B use_charnames_in_special
299This command indicates that troff should encode named characters inside
300special commands.
301.
302.TP
303.BI vert\  n
304The vertical resolution is
305.I n
306machine units.
307.
308.LP
309The
310.BR res ,
311.BR unitwidth ,
312.BR fonts ,
313and
314.B sizes
315lines are compulsory.
316.
317Not all commands in the DESC file are used by
318.B troff
319itself; some of the keywords (or even additional ones) are used by
320postprocessors to store arbitrary information about the device.
321.
322.LP
323Here a list of obsolete keywords which are recognized by
324.B groff
325but completely ignored:
326.BR spare1 ,
327.BR spare2 ,
328.BR biggestfont .
329.
330.
331.SS Font file format
332.
333A font file has two sections.
334The first section is a sequence
335of lines each containing a sequence of blank delimited
336words; the first word in the line is a key, and subsequent
337words give a value for that key.
338.
339.TP
340.BI ligatures\  lig1\ lig2\|.\|.\|.\|lign\ \fR[ 0 \fR]
341Characters
342.IR lig1 ,
343.IR lig2 ,\ \|.\|.\|.,\ lign
344are ligatures; possible ligatures are
345.BR ff ,
346.BR fi ,
347.BR fl ,
348.B ffi
349and
350.BR ffl .
351.
352For backwards compatibility, the list of ligatures may be terminated
353with a
354.BR 0.
355.
356The list of ligatures may not extend over more than one line.
357.
358.TP
359.BI name\  F
360The name of the font is
361.IR F .
362.
363.TP
364.BI slant\  n
365The characters of the font have a slant of
366.I n
367degrees.
368.
369(Positive means forward.)
370.
371.TP
372.BI spacewidth\  n
373The normal width of a space is
374.IR n .
375.
376.TP
377.B special
378The font is
379.IR special ;
380this means that when a character is requested that is not present in
381the current font, it will be searched for in any special fonts that
382are mounted.
383.
384.LP
385Other commands are ignored by
386.B troff
387but may be used by postprocessors to store arbitrary information
388about the font in the font file.
389.
390.LP
391The first section can contain comments which start with the
392.B #
393character and extend to the end of a line.
394.
395.LP
396The second section contains one or two subsections.
397.
398It must contain a
399.I charset
400subsection
401and it may also contain a
402.I kernpairs
403subsection.
404.
405These subsections can appear in any order.
406.
407Each subsection starts with a word on a line by itself.
408.
409.LP
410The word
411.B charset
412starts the charset subsection.
413.
414The
415.B charset
416line is followed by a sequence of lines.
417.
418Each line gives information for one character.
419.
420A line comprises a number of fields separated
421by blanks or tabs.
422.
423The format is
424.
425.IP
426.I name metrics type code 
427.RI [ entity_name ]
428.RB [ --
429.IR comment ]
430.
431.LP
432.I name
433identifies the character:
434if
435.I name
436is a single character
437.I c
438then it corresponds to the groff input character
439.IR c ;
440if it is of the form
441.BI \[rs] c
442where c is a single character, then it
443corresponds to the special character
444.BI \[rs][ c ]\fR;
445otherwise it corresponds to the groff input character
446.BI \[rs][ name ]\fR.
447.
448If it is exactly two characters
449.I xx
450it can be entered as
451.BI \[rs]( xx\fR.
452.
453Note that single-letter special characters can't be accessed as
454.BI \[rs] c\fR;
455the only exception is `\[rs]-' which is identical to `\[rs][-]'.
456.
457The name
458.B \-\-\-
459is special and indicates that the character is unnamed;
460such characters can only be used by means of the
461.B \[rs]N
462escape sequence in
463.BR troff .
464.
465.LP
466Groff supports eight-bit characters; however some utilities
467have difficulties with eight-bit characters.
468.
469For this reason, there is a convention that the name
470.BI char n
471is equivalent to the single character whose code is
472.IR n .
473.
474For example,
475.B char163
476would be equivalent to the character with code 163
477which is the pounds sterling sign in ISO Latin-1.
478.
479.LP
480The
481.I type
482field gives the character type:
483.
484.TP
4851
486means the character has a descender, for example, p;
487.
488.TP
4892
490means the character has an ascender, for example, b;
491.
492.TP
4933
494means the character has both an ascender and a descender, for example,
495(.
496.
497.LP
498The
499.I code
500field gives the code which the postprocessor uses to print the character.
501.
502The character can also be input to groff using this code by means of the
503.B \[rs]N
504escape sequence.
505.
506The code can be any integer.
507.
508If it starts with a
509.B 0
510it will be interpreted as octal;
511if it starts with
512.B 0x
513or
514.B 0X
515it will be intepreted as hexadecimal.
516.
517Note, however, that the
518.B \[rs]N
519escape sequence only accepts a decimal integer.
520.
521.LP
522The
523.I entity_name
524field gives an ascii string identifying the glyph which the postprocessor
525uses to print the character.
526.
527This field is optional and has been introduced so that the html device driver
528can encode its character set.
529.
530For example, the character `\[rs][Po]' is represented as `£' in
531html\~4.0.
532.
533.LP
534Anything on the line after the encoding field resp. after `-\&-' will
535be ignored.
536.
537.LP
538The
539.I metrics
540field has the form (in one line; it is broken here for the sake of
541readability):
542.
543.IP
544.I width\c
545.RI [\fB, height\c
546.RI [\fB, depth\c
547.RI [\fB, italic-correction
548.br
549.RI [\fB, left-italic-correction\c
550.RI [\fB, subscript-correction ]]]]]
551.
552.LP
553There must not be any spaces between these subfields.
554.
555Missing subfields are assumed to be 0.
556.
557The subfields are all decimal integers.
558.
559Since there is no associated binary format, these
560values are not required to fit into a variable of type
561.B char
562as they are in ditroff.
563.
564The
565.I width
566subfields gives the width of the character.
567.
568The
569.I height
570subfield gives the height of the character (upwards is positive);
571if a character does not extend above the baseline, it should be
572given a zero height, rather than a negative height.
573.
574The
575.I depth
576subfield gives the depth of the character, that is, the distance
577below the lowest point below the baseline to which the
578character extends (downwards is positive);
579if a character does not extend below above the baseline, it should be
580given a zero depth, rather than a negative depth.
581.
582The
583.I italic-correction
584subfield gives the amount of space that should be added after the
585character when it is immediately to be followed by a character
586from a roman font.
587.
588The
589.I left-italic-correction
590subfield gives the amount of space that should be added before the
591character when it is immediately to be preceded by a character
592from a roman font.
593.
594The
595.I subscript-correction
596gives the amount of space that should be added after a character
597before adding a subscript.
598.
599This should be less than the italic correction.
600.
601.LP
602A line in the charset section can also have the format
603.
604.IP
605.I
606name \fB"
607.
608.LP
609This indicates that
610.I name
611is just another name for the character mentioned in the
612preceding line.
613.
614.LP
615The word
616.B kernpairs
617starts the kernpairs section.
618.
619This contains a sequence of lines of the form:
620.
621.IP
622.I c1 c2 n
623.
624.LP
625This means that when character
626.I c1
627appears next to character
628.I c2
629the space between them should be increased by
630.IR n .
631.
632Most entries in kernpairs section will have a negative value for
633.IR n .
634.
635.
636.SH FILES
637.
638.Tp \w'@FONTDIR@/devname/DESC'u+3n
639.BI @FONTDIR@/dev name /DESC
640Device description file for device
641.IR name .
642.
643.TP
644.BI @FONTDIR@/dev name / F
645Font file for font
646.I F
647of device
648.IR name .
649.
650.
651.SH "SEE ALSO"
652.
653.BR groff_out (@MAN5EXT@),
654.BR @g@troff (@MAN1EXT@).
655.
656.cp \n[groff_font_C]
657.
658.\" Local Variables:
659.\" mode: nroff
660.\" End:
661