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

NAME

6       Font::TTF::Table - Superclass for tables and used for tables we don't
7       have a class for
8

DESCRIPTION

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

INSTANCE VARIABLES

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       nocompress
25           If set, overrides the font default for WOFF table compression. Is a
26           scalar integer specifying a table size threshold below which this
27           table will not be compressed. Set to -1 to never compress; 0 to
28           always compress.
29
30       INFILE
31           The read file handle
32
33       OFFSET
34           Location of the file in the input file
35
36       LENGTH
37           Length in the input directory
38
39       ZLENGTH
40           Compressed length of the table if a WOFF font. 0 < ZLENGTH < LENGTH
41           implies table is compressed.
42
43       CSUM
44           Checksum read from the input file's directory
45
46       PARENT
47           The Font::TTF::Font that table is part of
48

METHODS

50   Font::TTF::Table->new(%parms)
51       Creates a new table or subclass. Table instance variables are passed in
52       at this point as an associative array.
53
54   $t->read
55       Reads the table from the input file. Acts as a superclass to all true
56       tables.  This method marks the table as read and then just sets the
57       input file pointer but does not read any data. If the table has already
58       been read, then returns "undef" else returns $self
59
60   $t->read_dat
61       Reads the table into the "dat" instance variable for those tables which
62       don't know any better
63
64   $t->out($fh)
65       Writes out the table to the font file. If there is anything in the
66       "dat" instance variable then this is output, otherwise the data is
67       copied from the input file to the output
68
69   $t->out_xml($context)
70       Outputs this table in XML format. The table is first read (if not
71       already read) and then if there is no subclass, then the data is dumped
72       as hex data
73
74   $t->XML_element
75       Output a particular element based on its contents.
76
77   $t->XML_end($context, $tag, %attrs)
78       Handles the default type of <data> for those tables which aren't
79       subclassed
80
81   $t->dirty($val)
82       This sets the dirty flag to the given value or 1 if no given value. It
83       returns the value of the flag
84
85   $t->update
86       Each table knows how to update itself. This consists of doing whatever
87       work is required to ensure that the memory version of the table is
88       consistent and that other parameters in other tables have been updated
89       accordingly.  I.e. by the end of sending "update" to all the tables,
90       the memory version of the font should be entirely consistent.
91
92       Some tables which do no work indicate to themselves the need to update
93       themselves by setting isDirty above 1. This method resets that
94       accordingly.
95
96   $t->empty
97       Clears a table of all data to the level of not having been read
98
99   $t->release
100       Releases ALL of the memory used by this table, and all of its
101       component/child objects.  This method is called automatically by
102       'Font::TTF::Font->release' (so you don't have to call it yourself).
103
104       NOTE, that it is important that this method get called at some point
105       prior to the actual destruction of the object.  Internally, we track
106       things in a structure that can result in circular references, and
107       without calling '"release()"' these will not properly get cleaned up by
108       Perl.  Once this method has been called, though, don't expect to be
109       able to do anything with the "Font::TTF::Table" object; it'll have no
110       internal state whatsoever.
111
112       Developer note:  As part of the brute-force cleanup done here, this
113       method will throw a warning message whenever unexpected key values are
114       found within the "Font::TTF::Table" object.  This is done to help
115       ensure that any unexpected and unfreed values are brought to your
116       attention so that you can bug us to keep the module updated properly;
117       otherwise the potential for memory leaks due to dangling circular
118       references will exist.
119

BUGS

121       No known bugs
122

AUTHOR

124       Martin Hosken Martin_Hosken@sil.org. See Font::TTF::Font for copyright
125       and licensing.
126
127
128
129perl v5.16.3                      2012-02-23               Font::TTF::Table(3)
Impressum