Blame


1 058b0118 2005-01-03 devnull .TH FONT 7
2 058b0118 2005-01-03 devnull .SH NAME
3 058b0118 2005-01-03 devnull font, subfont \- external format for fonts and subfonts
4 058b0118 2005-01-03 devnull .SH SYNOPSIS
5 058b0118 2005-01-03 devnull .B #include <draw.h>
6 058b0118 2005-01-03 devnull .SH DESCRIPTION
7 058b0118 2005-01-03 devnull Fonts and subfonts are described in
8 058b0118 2005-01-03 devnull .IR cachechars (3).
9 058b0118 2005-01-03 devnull .PP
10 058b0118 2005-01-03 devnull External fonts are described by a plain text file that can be read using
11 058b0118 2005-01-03 devnull .IR openfont .
12 058b0118 2005-01-03 devnull The format of the file is a header followed by any number of
13 058b0118 2005-01-03 devnull subfont range specifications.
14 058b0118 2005-01-03 devnull The header contains two numbers: the height and the ascent, both in pixels.
15 058b0118 2005-01-03 devnull The height is the inter-line spacing and the ascent is the distance
16 058b0118 2005-01-03 devnull from the top of the line to the baseline. These numbers are chosen
17 058b0118 2005-01-03 devnull to display consistently all the subfonts of the font.
18 058b0118 2005-01-03 devnull A subfont range specification contains two or three numbers and a file name.
19 058b0118 2005-01-03 devnull The numbers are the inclusive range of characters covered by the subfont,
20 058b0118 2005-01-03 devnull with an optional starting position within the subfont,
21 058b0118 2005-01-03 devnull and the file name names an external file suitable for
22 058b0118 2005-01-03 devnull .I readsubfont
23 058b0118 2005-01-03 devnull (see
24 058b0118 2005-01-03 devnull .IR graphics (3)).
25 058b0118 2005-01-03 devnull The minimum number of a covered range is mapped to the specified starting position
26 058b0118 2005-01-03 devnull (default zero) of the
27 058b0118 2005-01-03 devnull corresponding subfont.
28 058b0118 2005-01-03 devnull If the subfont file name does not begin with a slash, it is taken relative to the
29 058b0118 2005-01-03 devnull directory containing the font file.
30 058b0118 2005-01-03 devnull Each field must be followed by some white space.
31 058b0118 2005-01-03 devnull Each numeric field may be C-format decimal, octal, or hexadecimal.
32 058b0118 2005-01-03 devnull .PP
33 058b0118 2005-01-03 devnull External subfonts are represented in a more rigid format
34 058b0118 2005-01-03 devnull that can be read and written using
35 058b0118 2005-01-03 devnull .I readsubfont
36 058b0118 2005-01-03 devnull and
37 058b0118 2005-01-03 devnull .I writesubfont
38 058b0118 2005-01-03 devnull (see
39 058b0118 2005-01-03 devnull .IR subfont (3)).
40 058b0118 2005-01-03 devnull The format for subfont files is: an image containing character glyphs,
41 058b0118 2005-01-03 devnull followed by a subfont header, followed by character information.
42 058b0118 2005-01-03 devnull The image has the format for external image files described in
43 058b0118 2005-01-03 devnull .IR image (7).
44 058b0118 2005-01-03 devnull The subfont header has 3
45 058b0118 2005-01-03 devnull decimal strings:
46 058b0118 2005-01-03 devnull .BR n ,
47 058b0118 2005-01-03 devnull .BR height ,
48 058b0118 2005-01-03 devnull and
49 058b0118 2005-01-03 devnull .BR ascent .
50 058b0118 2005-01-03 devnull Each number is right-justified and blank padded in 11 characters, followed by a blank.
51 058b0118 2005-01-03 devnull The character
52 058b0118 2005-01-03 devnull .B info
53 058b0118 2005-01-03 devnull consists of
54 058b0118 2005-01-03 devnull .BR n +1
55 058b0118 2005-01-03 devnull 6-byte entries, each giving the
56 058b0118 2005-01-03 devnull .B Fontchar
57 058b0118 2005-01-03 devnull .B x
58 058b0118 2005-01-03 devnull (2 bytes, low order byte first),
59 058b0118 2005-01-03 devnull .BR top ,
60 058b0118 2005-01-03 devnull .BR bottom ,
61 058b0118 2005-01-03 devnull .BR left ,
62 058b0118 2005-01-03 devnull and
63 058b0118 2005-01-03 devnull .BR width .
64 058b0118 2005-01-03 devnull The
65 058b0118 2005-01-03 devnull .B x
66 058b0118 2005-01-03 devnull field of the last
67 058b0118 2005-01-03 devnull .B Fontchar
68 058b0118 2005-01-03 devnull is used to calculate the image width
69 058b0118 2005-01-03 devnull of the previous character; the other fields in the last
70 058b0118 2005-01-03 devnull .B Fontchar
71 058b0118 2005-01-03 devnull are irrelevant.
72 058b0118 2005-01-03 devnull .PP
73 058b0118 2005-01-03 devnull Note that the convention of using the character with value zero (NUL) to represent
74 058b0118 2005-01-03 devnull characters of zero width (see
75 058b0118 2005-01-03 devnull .IR draw (3))
76 058b0118 2005-01-03 devnull means that fonts should have, as their zeroth character,
77 058b0118 2005-01-03 devnull one with non-zero width.
78 058b0118 2005-01-03 devnull .SH FILES
79 c8b6342d 2005-01-13 devnull .TF \*9/font/*
80 058b0118 2005-01-03 devnull .TP
81 c8b6342d 2005-01-13 devnull .B \*9/font/*
82 058b0118 2005-01-03 devnull font directories
83 058b0118 2005-01-03 devnull .SH "SEE ALSO"
84 058b0118 2005-01-03 devnull .IR graphics (3),
85 058b0118 2005-01-03 devnull .IR draw (3),
86 058b0118 2005-01-03 devnull .IR cachechars (3),
87 058b0118 2005-01-03 devnull .IR subfont (3)