1Font::TTF::Kern(3)    User Contributed Perl Documentation   Font::TTF::Kern(3)
2
3
4

NAME

6       Font::TTF::Kern - Kerning tables
7

DESCRIPTION

9       Kerning tables are held as an ordered collection of subtables each giv‐
10       ing incremental information regarding the kerning of various pairs of
11       glyphs.
12
13       The basic structure of the kerning data structure is:
14
15           $kern = $f->{'kern'}{'tables'}[$tnum]{'kerns'}{$leftnum}{$rightnum};
16
17       Due to the possible complexity of some kerning tables the above infor‐
18       mation is insufficient. Reference also needs to be made to the type of
19       the table and the coverage field.
20

INSTANCE VARIABLES

22       The instance variables for a kerning table are relatively straightfor‐
23       ward.
24
25       Version
26           Version number of the kerning table
27
28       Num Number of subtables in the kerning table
29
30       tables
31           Array of subtables in the kerning table
32
33               Each subtable has a number of instance variables.
34
35           kern
36               A two level hash array containing kerning values. The indexing
37               is left value and then right value. In the case of type 2
38               tables, the indexing is via left class and right class. It may
39               seem using hashes is strange, but most tables are not type 2
40               and this method saves empty array values.
41
42           type
43               Stores the table type. Only type 0 and type 2 tables are speci‐
44               fied for TrueType so far.
45
46           coverage
47               A bit field of coverage information regarding the kerning
48               value. See the TrueType specification for details.
49
50           Version
51               Contains the version number of the table.
52
53           Num Number of kerning pairs in this type 0 table.
54
55           left
56               An array indexed by glyph - left_first which returns a class
57               number for the glyph in type 2 tables.
58
59           right
60               An array indexed by glyph - right_first which returns a class
61               number for the glyph in type 2 tables.
62
63           left_first
64               the glyph number of the first element in the left array for
65               type 2 tables.
66
67           right_first
68               the glyph number of the first element in the right array for
69               type 2 tables.
70
71           num_left
72               Number of left classes
73
74           num_right
75               Number of right classes
76

METHODS

78       $t->read
79
80       Reads the whole kerning table into structures
81
82       $t->out($fh)
83
84       Outputs the kerning tables to the given file
85
86       $t->XML_element($context, $depth, $key, $value)
87
88       Handles outputting the kern hash into XML a little more tidily
89

BUGS

91       ·   Only supports kerning table types 0 & 2.
92
93       ·   No real support functions to do anything with the kerning tables
94           yet.
95

AUTHOR

97       Martin Hosken Martin_Hosken@sil.org. See Font::TTF::Font for copyright
98       and licensing.
99
100
101
102perl v5.8.8                       2005-06-14                Font::TTF::Kern(3)
Impressum