.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Font::TTF::Table 3pm" .TH Font::TTF::Table 3pm "2022-06-14" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Font::TTF::Table \- Superclass for tables and used for tables we don't have a class for .SH "DESCRIPTION" .IX Header "DESCRIPTION" Looks after the purely table aspects of a \s-1TTF\s0 table, such as whether the table has been read before, locating the file pointer, etc. Also copies tables from input to output. .SH "INSTANCE VARIABLES" .IX Header "INSTANCE VARIABLES" Instance variables start with a space .IP "read" 4 .IX Item "read" Flag which indicates that the table has already been read from file. .IP "dat" 4 .IX Item "dat" Allows the creation of unspecific tables. Data is simply output to any font file being created. .IP "nocompress" 4 .IX Item "nocompress" If set, overrides the font default for \s-1WOFF\s0 table compression. Is a scalar integer specifying a table size threshold below which this table will not be compressed. Set to \-1 to never compress; 0 to always compress. .IP "\s-1INFILE\s0" 4 .IX Item "INFILE" The read file handle .IP "\s-1OFFSET\s0" 4 .IX Item "OFFSET" Location of the file in the input file .IP "\s-1LENGTH\s0" 4 .IX Item "LENGTH" Length in the input directory .IP "\s-1ZLENGTH\s0" 4 .IX Item "ZLENGTH" Compressed length of the table if a \s-1WOFF\s0 font. 0 < \s-1ZLENGTH\s0 < \s-1LENGTH\s0 implies table is compressed. .IP "\s-1CSUM\s0" 4 .IX Item "CSUM" Checksum read from the input file's directory .IP "\s-1PARENT\s0" 4 .IX Item "PARENT" The Font::TTF::Font that table is part of .SH "METHODS" .IX Header "METHODS" .SS "Font::TTF::Table\->new(%parms)" .IX Subsection "Font::TTF::Table->new(%parms)" Creates a new table or subclass. Table instance variables are passed in at this point as an associative array. .ie n .SS "$t\->read" .el .SS "\f(CW$t\fP\->read" .IX Subsection "$t->read" Reads the table from the input file. Acts as a superclass to all true tables. This method marks the table as read and then just sets the input file pointer but does not read any data. If the table has already been read, then returns \&\f(CW\*(C`undef\*(C'\fR else returns \f(CW$self\fR .PP For WOFF-compressed tables, the table is first decompressed and a replacement file handle is created for reading the decompressed data. In this case \s-1ORIGINALOFFSET\s0 will preserve the original value of \s-1OFFSET\s0 for applications that care. .ie n .SS "$t\->read_dat" .el .SS "\f(CW$t\fP\->read_dat" .IX Subsection "$t->read_dat" Reads the table into the \f(CW\*(C`dat\*(C'\fR instance variable for those tables which don't know any better .ie n .SS "$t\->out($fh)" .el .SS "\f(CW$t\fP\->out($fh)" .IX Subsection "$t->out($fh)" Writes out the table to the font file. If there is anything in the \&\f(CW\*(C`dat\*(C'\fR instance variable then this is output, otherwise the data is copied from the input file to the output .ie n .SS "$t\->out_xml($context)" .el .SS "\f(CW$t\fP\->out_xml($context)" .IX Subsection "$t->out_xml($context)" Outputs this table in \s-1XML\s0 format. The table is first read (if not already read) and then if there is no subclass, then the data is dumped as hex data .ie n .SS "$t\->XML_element" .el .SS "\f(CW$t\fP\->XML_element" .IX Subsection "$t->XML_element" Output a particular element based on its contents. .ie n .SS "$t\->XML_end($context, $tag, %attrs)" .el .SS "\f(CW$t\fP\->XML_end($context, \f(CW$tag\fP, \f(CW%attrs\fP)" .IX Subsection "$t->XML_end($context, $tag, %attrs)" Handles the default type of for those tables which aren't subclassed .ie n .SS "$t\->\fBminsize()\fP" .el .SS "\f(CW$t\fP\->\fBminsize()\fP" .IX Subsection "$t->minsize()" Returns the minimum size this table can be. If it is smaller than this, then the table must be bad and should be deleted or whatever. .ie n .SS "$t\->dirty($val)" .el .SS "\f(CW$t\fP\->dirty($val)" .IX Subsection "$t->dirty($val)" This sets the dirty flag to the given value or 1 if no given value. It returns the value of the flag .ie n .SS "$t\->update" .el .SS "\f(CW$t\fP\->update" .IX Subsection "$t->update" Each table knows how to update itself. This consists of doing whatever work is required to ensure that the memory version of the table is consistent and that other parameters in other tables have been updated accordingly. I.e. by the end of sending \f(CW\*(C`update\*(C'\fR to all the tables, the memory version of the font should be entirely consistent. .PP Some tables which do no work indicate to themselves the need to update themselves by setting isDirty above 1. This method resets that accordingly. .ie n .SS "$t\->empty" .el .SS "\f(CW$t\fP\->empty" .IX Subsection "$t->empty" Clears a table of all data to the level of not having been read .ie n .SS "$t\->release" .el .SS "\f(CW$t\fP\->release" .IX Subsection "$t->release" Releases \s-1ALL\s0 of the memory used by this table, and all of its component/child objects. This method is called automatically by \&'Font::TTF::Font\->release' (so you don't have to call it yourself). .PP \&\fB\s-1NOTE\s0\fR, that it is important that this method get called at some point prior to the actual destruction of the object. Internally, we track things in a structure that can result in circular references, and without calling \&'\f(CW\*(C`release()\*(C'\fR' these will not properly get cleaned up by Perl. Once this method has been called, though, don't expect to be able to do anything with the \&\f(CW\*(C`Font::TTF::Table\*(C'\fR object; it'll have \fBno\fR internal state whatsoever. .PP \&\fBDeveloper note:\fR As part of the brute-force cleanup done here, this method will throw a warning message whenever unexpected key values are found within the \f(CW\*(C`Font::TTF::Table\*(C'\fR object. This is done to help ensure that any unexpected and unfreed values are brought to your attention so that you can bug us to keep the module updated properly; otherwise the potential for memory leaks due to dangling circular references will exist. .SH "BUGS" .IX Header "BUGS" No known bugs .SH "AUTHOR" .IX Header "AUTHOR" Martin Hosken . .SH "LICENSING" .IX Header "LICENSING" Copyright (c) 1998\-2016, \s-1SIL\s0 International (http://www.sil.org) .PP This module is released under the terms of the Artistic License 2.0. For details, see the full text of the license in the file \s-1LICENSE.\s0