.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29) .\" .\" 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 turned on, 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::XMLparse 3pm" .TH Font::TTF::XMLparse 3pm "2016-08-28" "perl v5.22.2" "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::XMLparse \- provides support for XML parsing. Requires Expat module XML::Parser::Expat .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use Font::TTF::Font; \& use Font::TTF::XMLparse; \& \& $f = Font::TTF::Font\->new; \& read_xml($f, $ARGV[0]); \& $f\->out($ARGV[1]); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module contains the support routines for parsing \s-1XML\s0 and generating the Truetype font structures as a result. The module has been separated from the rest of the package in order to reduce the dependency that this would bring, of the whole package on XML::Parser. This way, people without the XML::Parser can still use the rest of the package. .PP The package interacts with another package through the use of a context containing and element 'receiver' which is an object which can possibly receive one of the following messages: .IP "XML_start" 4 .IX Item "XML_start" This message is called when an open tag occurs. It is called with the context, tag name and the attributes. The return value has no meaning. .IP "XML_end" 4 .IX Item "XML_end" This messages is called when a close tag occurs. It is called with the context, tag name and attributes (held over from when the tag was opened). There are 3 possible return values from such a message: .RS 4 .IP "undef" 8 .IX Item "undef" This is the default return value indicating that default processing should occur in which either the current element on the tree, or the text of this element should be stored in the parent object. .ie n .IP "$context" 8 .el .IP "\f(CW$context\fR" 8 .IX Item "$context" This magic value marks that the element should be deleted from the parent. Nothing is stored in the parent. (This rather than '' is used to allow 0 returns.) .IP "anything" 8 .IX Item "anything" Anything else is taken as the element content to be stored in the parent. .RE .RS 4 .Sp In addition, the context hash passed to these messages contains the following keys: .IP "xml" 4 .IX Item "xml" This is the expat xml object. The context is also available as \&\f(CW$context\fR\->{'xml'}{' mycontext'}. But that is a long winded way of not saying much! .IP "font" 4 .IX Item "font" This is the base object that was passed in for \s-1XML\s0 parsing. .IP "receiver" 4 .IX Item "receiver" This holds the current receiver of parsing events. It may be set in associated application to adjust which objects should receive messages when. It is also stored in the parsing stack to ensure that where an object changes it during XML_start, that that same object that received XML_start will receive the corresponding XML_end .IP "stack" 4 .IX Item "stack" This is the parsing stack, used internally to hold the current receiver and attributes for each element open, as a complete hierarchy back to the root element. .IP "tree" 4 .IX Item "tree" This element contains the storage tree corresponding to the parent of each element in the stack. The default action is to push undef onto this stack during XML_start and then to resolve this, either in the associated application (by changing \&\f(CW$context\fR\->{'tree'}[\-1]) or during XML_end of a child element, by which time we know whether we are dealing with an array or a hash or what. .IP "text" 4 .IX Item "text" Character processing is to insert all the characters into the text element of the context for available use later. .RE .RS 4 .RE .SH "METHODS" .IX Header "METHODS" .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