|nocsum||This is used during output to disable the creation of the file checksum in the head table. For example, during DSIG table creation, this flag will be set to ensure that the file checksum is left at zero.|
|fname (R)||Contains the filename of the font which this object was read from.|
|INFILE (P)||The file handle which reflects the source file for this font.|
|OFFSET (P)||Contains the offset from the beginning of the read file of this particular font directory, thus providing support for TrueType Collections.|
PDF::API3::Compat::API2::Basic::TTF::Font->AddTable($tablename, CW$class)Adds the given class to be used when representing the given table name. It also requires the class for you.
For those people who like making fonts without reading them. This subroutine will require all the table code for the various table types for you. Not needed if using PDF::API3::Compat::API2::Basic::TTF::Font::read before using a table.
Creates a new font object and initialises with the given properties. This is primarily for use when a TTF is embedded somewhere. Notice that the properties are automatically preceded by a space when inserted into the object. This is in order that fields do not clash with tables.
Reads the header and directory for the given font file and creates appropriate objects for each table in the font.
CW$f->readReads a Truetype font directory starting from the current location in the file. This has been separated from the open function to allow support for embedded TTFs for example in TTCs. Also reads the head and maxp tables immediately.
CW$f->out($fname [, CW@tablelist])Writes a TTF file consisting of the tables in tablelist. The list is checked to ensure that only tables that exist are output. (This means that you cant have non table information stored in the font object with key length of exactly 4)
In many cases the user simply wants to output all the tables in alphabetical order. This can be done by not including a @tablelist, in which case the subroutine will output all the defined tables in the font in alphabetical order.
Returns $f on success and undef on failure, including warnings.
All output files must include the head table.
CW$f->out_xml($filename [, CW@tables])Outputs the font in XML format
CW$f->XML_start($context, CW$tag, CW%attrs)Handles start messages from the XML parser. Of particular interest to us are <font> and <table>.
CW$f->updateSends update to all the tables in the font and then resets all the isDirty flags on each table. The data structure in now consistent as a font (we hope).
CW$f->dirtyDirties all the tables in the font
CW$f->tables_do(&func)Calls &func for each table in the font. Calls the table in alphabetical sort order as per the order in the directory:
CW$f->releaseReleases ALL of the memory used by the TTF font and all of its component objects. After calling this method, do <B>NOTB> expect to have anything left in the PDF::API3::Compat::API2::Basic::TTF::Font object.
<B>NOTEB>, that it is important that you call this method on any PDF::API3::Compat::API2::Basic::TTF::Font object when you wish to destruct it and free up its memory. Internally, we track things in a structure that can result in circular references, and without calling release() these will not properly get cleaned up by Perl. Once youve called this method, though, dont expect to be able to do anything else with the PDF::API3::Compat::API2::Basic::TTF::Font object; itll have <B>noB> internal state whatsoever.
<B>Developer note:B> As part of the brute-force cleanup done here, this method will throw a warning message whenever unexpected key values are found within the PDF::API3::Compat::API2::Basic::TTF::Font 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.
Bugs abound aplenty I am sure. There is a lot of code here and plenty of scope. The parts of the code which havent been implemented yet are:
In addition there are weaknesses or features of this module library
Post Version 4 format types are not supported yet. Cmap Format type 2 (MBCS) has not been implemented yet and therefore may cause somewhat spurious results for this table type. Kern Only type 0 & type 2 tables are supported (type 1 & type 3 yet to come). TTC The current PDF::API3::Compat::API2::Basic::TTF::Font::out method does not support the writing of TrueType Collections.
Apart from these, I try to keep the code in a state of no known bugs, which given the amount of testing this code has had, is not a guarantee of high quality, yet.
o There is very little (or no) error reporting. This means that if you have garbled data or garbled data structures, then you are liable to generate duff fonts. o The exposing of the internal data structures everywhere means that doing radical re-structuring is almost impossible. But it stop the code from becoming ridiculously large.
For more details see the appropriate class files.
Martin Hosken Martin_Hosken@sil.org
Copyright Martin Hosken 1998.
No warranty or expression of effectiveness, least of all regarding anyones safety, is implied in this software or documentation.
The Perl TTF module is licensed under the Perl Artistic License.
|perl v5.20.3||PDF::API3::COMPAT::API2::BASIC::TTF::FONT (3)||2009-04-21|