Document::Writer::TextLayout - Text layout engine
use Document::Writer; my $doc = Document::Writer->new(default_color => ...); my $p = $doc->next_page($width, $height); $p->add_text_to_page($driver, $font, $text); ...
Set/Get this text layout's font.
Get the height of this text layout. Only useful after layout has been called.
layout
Lay out the text based on the provided attributes.
Set/Get this text layout's 'lines'. This is an arrayref of hashrefs, where each hashref has the following members:
The bounding box for the text in this line. This bounding box does not take rotations into consideration.
The bounding box of required for a container that intends to contain the text in this line.
The text in this line.
This data structure is the meat of a TextLayout. The multi-line, unwrapped text is broken down into this datastructure based on the width attribute.
width
Given an offset and an optional size, returns n lines from this layout that come as close to $size without exceeding it. This method is provided to allow incremental rendering of text. For example, if you have a series of containers 80 units high, you might write code like this:
n
$size
for(my $i = 0; $i < 3; $i++) { $lines = $layout->slice($i * 80, 80); # render the text }
Set/Get the text to be laid out.
Get/Set the width at which the text in this TextLayout should be wrapped.
Cory Watson, <gphat@cpan.org>
<gphat@cpan.org>
Infinity Interactive, http://www.iinteractive.com
Please report any bugs or feature requests to bug-geometry-primitive at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Geometry-Primitive. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-geometry-primitive at rt.cpan.org
Copyright 2008 by Infinity Interactive, Inc.
http://www.iinteractive.com
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Graphics::Primitive::Driver::Cairo, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Graphics::Primitive::Driver::Cairo
CPAN shell
perl -MCPAN -e shell install Graphics::Primitive::Driver::Cairo
For more information on module installation, please visit the detailed CPAN module installation guide.