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

NAME

6       Font::TTF::GPOS - Support for Opentype GPOS tables in conjunction with
7       TTOpen
8

DESCRIPTION

10       The GPOS table is one of the most complicated tables in the TTF spec
11       and the corresponding data structure abstraction is also not trivial.
12       While much of the structure of a GPOS is shared with a GSUB table via
13       the Font::TTF::Ttopen
14

INSTANCE VARIABLES

16       Here we describe the additions and lookup specific information for GPOS
17       tables.  Unfortunately there is no one abstraction which seems to work
18       comfortable for all GPOS tables, so we will also examine how the vari‐
19       ables are used for different lookup types.
20
21       The following are the values allowed in the ACTION_TYPE and MATCH_TYPE
22       variables:
23
24       ACTION_TYPE
25           This can take any of the following values
26
27           a       The ACTION is an array of anchor tables
28
29           o       Offset. There is no RULE array. The ADJUST variable con‐
30                   tains a value record (see later in this description)
31
32           v       The ACTION is a value record.
33
34           p       Pair adjustment. The ACTION contains an array of two value
35                   records for the matched two glyphs.
36
37           e       Exit and Entry records. The ACTION contains an array of two
38                   anchors corresponding to the exit and entry anchors for the
39                   glyph.
40
41           l       Indicates a lookup based contextual rule as per the GSUB
42                   table.
43
44       MATCH_TYPE
45           This can take any of the following values
46
47           g       A glyph array
48
49           c       An array of class values
50
51           o       An array of coverage tables
52
53       The following variables are added for Attachment Positioning Subtables:
54
55       MATCH
56           This contains an array of glyphs to match against for all RULES. It
57           is much like having the same MATCH string in all RULES. In the
58           cases it is used so far, it only ever contains one element.
59
60       MARKS
61           This contains a Mark array consisting of each element being a sub‐
62           array of two elements:
63
64           CLASS   The class that this mark uses on its base
65
66           ANCHOR  The anchor with which to attach this mark glyph
67
68           The base table for mark to base, ligature or mark attachment posi‐
69           tioning is structured with the ACTION containing an array of
70           anchors corresponding to each attachment class. For ligatures,
71           there is more than one RULE in the RULE array corresponding to each
72           glyph in the coverage table.
73
74       Other variables which are provided for informational purposes are:
75
76       VFMT
77           Value format for the adjustment of the glyph matched by the cover‐
78           age table.
79
80       VFMT2
81           Value format used in pair adjustment for the second glyph in the
82           pair
83
84       Value Records
85
86       There is a subtype used in GPOS tables called a value record. It is
87       used to adjust the position of a glyph from its default position. The
88       value record is variable length with a bitfield at the beginning to
89       indicate which of the following entries are included. The bitfield is
90       not stored since it is recalculated at write time.
91
92       XPlacement
93           Horizontal adjustment for placement (not affecting other unattached
94           glyphs)
95
96       YPlacement
97           Vertical adjustment for placement (not affecting other unattached
98           glyphs)
99
100       XAdvance
101           Adjust the advance width glyph (used only in horizontal writing
102           systems)
103
104       YAdvance
105           Adjust the vertical advance (used only in vertical writing systems)
106
107       XPlaDevice
108           Device table for device specific adjustment of horizontal placement
109
110       YPlaDevice
111           Device table for device specific adjustment of vertical placement
112
113       XAdvDevice
114           Device table for device specific adjustment of horizontal advance
115
116       YAdDevice
117           Device table for device specific adjustment of vertical advance
118
119       XIdPlacement
120           Horizontal placement metric id (for Multiple Master fonts - but
121           that's all I know!)
122
123       YIdPlacement
124           Vertical placement metric id
125
126       XIdAdvance
127           Horizontal advance metric id
128
129       YIdAdvance
130           Vertical advance metric id
131

CORRESPONDANCE TO LAYOUT TYPES

133       Here is what is stored in the ACTION_TYPE and MATCH_TYPE for each of
134       the known GPOS subtable types:
135
136                       1.1 1.2 2.1 2.2 3   4   5   6   7.1 7.2 7.3 8.1 8.2 8.3
137         ACTION_TYPE    o   v   p   p  e   a   a   a    l   l   l   l   l   l
138         MATCH_TYPE             g   c                   g   c   o   g   c   o
139

METHODS

141       read_sub
142
143       Reads the subtable into the data structures
144
145       $t->extension
146
147       Returns the table type number for the extension table
148
149       $t->out_sub
150
151       Outputs the subtable to the given filehandle
152
153       $t->read_value($format, $base, $lookup, $fh)
154
155       Reads a value record from the current location in the file, according
156       to the format given.
157
158       $t->read_delta($offset, $base, $lookup, $fh)
159
160       Reads a delta (device table) at the given offset if it hasn't already
161       been read.  Store the offset and item in the lookup cache ($lookup->{'
162       CACHE'})
163
164       $t->read_anchor($offset, $base, $lookup, $fh)
165
166       Reads an Anchor table at the given offset if it hasn't already been
167       read.
168
169       $t->fmt_value
170
171       Returns the value format for a given value record
172
173       $t->out_value
174
175       Returns the output string for the outputting of the value for a given
176       format. Also updates the offset cache for any device tables referenced.
177

AUTHOR

179       Martin Hosken Martin_Hosken@sil.org. See Font::TTF::Font for copyright
180       and licensing.
181
182
183
184perl v5.8.8                       2005-06-14                Font::TTF::GPOS(3)
Impressum