Lutz Gehlen > SVG-Rasterize > SVG::Rasterize::State::Text

Download:
SVG-Rasterize-0.003008.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  1
View/Report Bugs
Module Version: 0.003008   Source  

NAME ^

SVG::Rasterize::State::Text - state of a text/text content node

VERSION ^

Version 0.003008

DESCRIPTION ^

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.

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.

INTERFACE ^

Constructors

new/init

Inherited from SVG::Rasterize::State.

Public Attributes

text_atoms

Readonly attribute. Holds the reference to an array of HASH references. The array is filled during initialization. Each hash has the following entries:

x_buffer

ARRAY reference, list of explicit x positions that this element still has to offer.

y_buffer

Same for y.

dx_buffer

Same for dx.

dy_buffer

Same for dy.

rotate_buffer

Same for rotate.

Methods for Users

None.

Methods for Developers

process_node_extra

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.

add_text_atoms

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.

DIAGNOSTICS ^

Exceptions

Not documented, yet. Sorry.

Warnings

Not documented, yet. Sorry.

INTERNALS ^

Internal Methods

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.

AUTHOR ^

Lutz Gehlen, <perl at lutzgehlen.de>

LICENSE AND COPYRIGHT ^

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.

syntax highlighting: