1Font::TTF::Table(3) User Contributed Perl Documentation Font::TTF::Table(3)
2
3
4
6 Font::TTF::Table - Superclass for tables and used for tables we don't
7 have a class for
8
10 Looks after the purely table aspects of a TTF table, such as whether
11 the table has been read before, locating the file pointer, etc. Also
12 copies tables from input to output.
13
15 Instance variables start with a space
16
17 read
18 Flag which indicates that the table has already been read from
19 file.
20
21 dat Allows the creation of unspecific tables. Data is simply output to
22 any font file being created.
23
24 INFILE
25 The read file handle
26
27 OFFSET
28 Location of the file in the input file
29
30 LENGTH
31 Length in the input directory
32
33 CSUM
34 Checksum read from the input file's directory
35
36 PARENT
37 The Font::TTF::Font that table is part of
38
40 Font::TTF::Table->new(%parms)
41
42 Creates a new table or subclass. Table instance variables are passed in
43 at this point as an associative array.
44
45 $t->read
46
47 Reads the table from the input file. Acts as a superclass to all true
48 tables. This method marks the table as read and then just sets the
49 input file pointer but does not read any data. If the table has already
50 been read, then returns "undef" else returns $self
51
52 $t->read_dat
53
54 Reads the table into the "dat" instance variable for those tables which
55 don't know any better
56
57 $t->out($fh)
58
59 Writes out the table to the font file. If there is anything in the
60 "data" instance variable then this is output, otherwise the data is
61 copied from the input file to the output
62
63 $t->out_xml($context)
64
65 Outputs this table in XML format. The table is first read (if not
66 already read) and then if there is no subclass, then the data is dumped
67 as hex data
68
69 $t->XML_element
70
71 Output a particular element based on its contents.
72
73 $t->XML_end($context, $tag, %attrs)
74
75 Handles the default type of <data> for those tables which aren't sub‐
76 classed
77
78 $t->dirty($val)
79
80 This sets the dirty flag to the given value or 1 if no given value. It
81 returns the value of the flag
82
83 $t->update
84
85 Each table knows how to update itself. This consists of doing whatever
86 work is required to ensure that the memory version of the table is con‐
87 sistent and that other parameters in other tables have been updated
88 accordingly. I.e. by the end of sending "update" to all the tables,
89 the memory version of the font should be entirely consistent.
90
91 Some tables which do no work indicate to themselves the need to update
92 themselves by setting isDirty above 1. This method resets that accord‐
93 ingly.
94
95 $t->empty
96
97 Clears a table of all data to the level of not having been read
98
99 $t->release
100
101 Releases ALL of the memory used by this table, and all of its compo‐
102 nent/child objects. This method is called automatically by
103 '"Font::TTF::Font->release"' (so you don't have to call it yourself).
104
105 NOTE, that it is important that this method get called at some point
106 prior to the actual destruction of the object. Internally, we track
107 things in a structure that can result in circular references, and with‐
108 out calling '"release()"' these will not properly get cleaned up by
109 Perl. Once this method has been called, though, don't expect to be
110 able to do anything with the "Font::TTF::Table" object; it'll have no
111 internal state whatsoever.
112
113 Developer note: As part of the brute-force cleanup done here, this
114 method will throw a warning message whenever unexpected key values are
115 found within the "Font::TTF::Table" object. This is done to help
116 ensure that any unexpected and unfreed values are brought to your
117 attention so that you can bug us to keep the module updated properly;
118 otherwise the potential for memory leaks due to dangling circular ref‐
119 erences will exist.
120
122 No known bugs
123
125 Martin Hosken Martin_Hosken@sil.org. See Font::TTF::Font for copyright
126 and licensing.
127
128
129
130perl v5.8.8 2005-06-14 Font::TTF::Table(3)