NAME
SVG::Rasterize::Engine::PangoCairo
- rasterize output using Cairo
VERSION
Version 0.003007
SYNOPSIS
# explicit construction (unusual)
use SVG::Rasterize::Engine::PangoCairo;
my $engine = SVG::Rasterize::Engine::PangoCairo->new
(width => 640, height => 480);
DESCRIPTION
This class provides a rasterization backend for SVG::Rasterize based on the Cairo and Pango libraries.
This class is only instantiated by the rasterize method of SVG::Rasterize
.
INTERFACE
Constructors
new
SVG::Rasterize::Engine::PangoCairo->new(%args)
Creates a new SVG::Rasterize::Engine::PangoCairo
object and calls init(%args)
. If you subclass SVG::Rasterize::Engine::PangoCairo
overload init
, not new
.
init
$cairo->init(%args)
If you overload init
, your method should also call this one. It initializes the attributes width and height which are mandatory parameters and have to be non-negative integers.
Other backends are also required to validate their init parameters because the engine_args hash given by the user to SVG::Rasterize
is handed over to the new
constructor of the engine class without validation.
Public Attributes
Methods for Developers
See <SVG::Rasterize::Engine|SVG::Rasterize::Engine>.
draw_path
text_width
draw_text
write
$engine->write(%args)
Writes the rendered image to a file.
Example:
$engine->write(type => 'png', file_name => 'foo.png');
type
and file_name
are the only supported parameters at the moment and the only supported type is "png". If file_name
has a false value, no output is written and a warning is issued. Besides that, file_name
is not validated at all. Make sure that you provide a sane value (whatever that means to you).
DIAGNOSTICS
Exceptions
Warnings
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.
_prepare_fill
_prepare_stroke
_fill
_stroke
_fill_and_stroke
make_ro_accessor
This piece of documentation is mainly here to make the
POD
coverage test happy.SVG::Rasterize::State
overloadsmake_ro_accessor
to make the readonly accessors throw an exception object (of classSVG::Rasterize::Exception::Attribute
) instead of just croaking.
AUTHOR
Lutz Gehlen, <perl at lutzgehlen.de>
LICENSE AND COPYRIGHT
Copyright 2010-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.