SVG::Rasterize::State::Text - state of a text/text content node
SVG::Rasterize::State::Text
Version 0.003008
Text and text content nodes need special functionality. The hardest part belongs to the character data nodes, which contain the actual text. Their characters might have specific position settings, which may be inherited from upstream tspan, text, or textPath nodes.
tspan
text
textPath
This class implements a process_node_extra method overloading the empty one of SVG::Rasterize::State. This method splits character data into atoms where an atom (this term is coined by me while chunk and block are taken from the SVG specification) is a sequence of characters that can be handed to the rasterization engine in one go. Note that the atoms defined here might be split up further directly before rasterization due to bidirectional text.
SVG
Inherited from SVG::Rasterize::State.
Readonly attribute. Holds the reference to an array of HASH references. The array is filled during initialization. Each hash has the following entries:
x: explicit x value if given
y: explicit y value if given
dx: explicit dx value if given
dy: explicit dy value if given
rotate: explicit rotate value if given
chunkID: number of the text chunk this atom belongs to
new_chunk
only present for first atom of each chunk, leftover of processing, should not be used
blockID
number of the independent text block this atom belongs to
new_block
only present for first atom of each block, leftover of processing, should not be used
atomID
number of the atom, equal to the length of text before this atom thereby allowing further splitting without renumbering
cdata: the actual characters of this atom
state: weak reference to this object.
ARRAY reference, list of explicit x positions that this element still has to offer.
Same for y.
Same for dx.
Same for dy.
Same for rotate.
None.
Overloads the empty method of SVG::Rasterize::State.
Has two modes of operation. For elements, it saves the position attributes if present into buffer copies from which they can be shifted by character data child nodes.
For character data nodes, it splits the string into atoms assigning position values (if provided by ancestors) to the characters.
Called by process_node_extra. Takes a list of atom HASH references and pushes them to the text_atoms list. Calls itself on the ancestor text or textPath element. At this call, it sets chunkID, blockID, and atomID.
Not documented, yet. Sorry.
These methods are just documented for myself. You can read on to satisfy your voyeuristic desires, but be aware of that they might change or vanish without notice in a future version.
make_ro_accessor
This piece of documentation is mainly here to make the POD coverage test happy. SVG::Rasterize::State::Text overloads make_ro_accessor to make the readonly accessors throw an exception object (of class SVG::Rasterize::Exception::Attribute) instead of just croaking.
POD
SVG::Rasterize::Exception::Attribute
Lutz Gehlen, <perl at lutzgehlen.de>
<perl at lutzgehlen.de>
Copyright 2011 Lutz Gehlen.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install SVG::Rasterize, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SVG::Rasterize
CPAN shell
perl -MCPAN -e shell install SVG::Rasterize
For more information on module installation, please visit the detailed CPAN module installation guide.