.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" 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 >0, 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 "Graphics::Primitive::Driver::Cairo 3pm" .TH Graphics::Primitive::Driver::Cairo 3pm "2022-06-14" "perl v5.34.0" "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" Graphics::Primitive::Driver::Cairo \- Cairo backend for Graphics::Primitive .SH "VERSION" .IX Header "VERSION" version 0.47 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use Graphics::Primitive::Component; \& use Graphics::Primitive::Driver::Cairo; \& \& my $driver = Graphics::Primitive::Driver::Cairo\->new; \& my $container = Graphics::Primitive::Container\->new( \& width => 800, \& height => 600 \& ); \& my $black = Graphics::Primitive::Color\->new(red => 0, green => 0, blue => 0); \& $container\->border\->width(1); \& $container\->border\->color($black); \& $container\->padding( \& Graphics::Primitive::Insets\->new(top => 5, bottom => 5, left => 5, right => 5) \& ); \& my $comp = Graphics::Primitive::Component\->new; \& $comp\->background_color($black); \& $container\->add_component($comp, \*(Aqc\*(Aq); \& \& my $lm = Layout::Manager::Compass\->new; \& $lm\->do_layout($container); \& \& my $driver = Graphics::Primitive::Driver::Cairo\->new( \& format => \*(AqPDF\*(Aq \& ); \& $driver\->draw($container); \& $driver\->write(\*(Aq/Users/gphat/foo.pdf\*(Aq); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module draws Graphics::Primitive objects using Cairo. .SH "IMPLEMENTATION DETAILS" .IX Header "IMPLEMENTATION DETAILS" .IP "\fBBorders\fR" 4 .IX Item "Borders" Borders are drawn clockwise starting with the top one. Since cairo can't do line-joins on different colored lines, each border overlaps those before it. This is not the way I'd like it to work, but i'm opting to fix this later. Consider yourself warned. .SH "ATTRIBUTES" .IX Header "ATTRIBUTES" .SS "antialias_mode" .IX Subsection "antialias_mode" Set/Get the antialias mode of this driver. Options are default, none, gray and subpixel. .SS "cairo" .IX Subsection "cairo" This driver's Cairo::Context object .SS "format" .IX Subsection "format" Get the format for this driver. .SS "surface" .IX Subsection "surface" Get/Set the surface on which this driver is operating. .SH "METHODS" .IX Header "METHODS" .SS "data" .IX Subsection "data" Get the data in a scalar for this driver. .SS "write ($file)" .IX Subsection "write ($file)" Write this driver's data to the specified file. .ie n .SS "get_text_bounding_box ($font, $text, $angle)" .el .SS "get_text_bounding_box ($font, \f(CW$text\fP, \f(CW$angle\fP)" .IX Subsection "get_text_bounding_box ($font, $text, $angle)" Returns two Rectangles that encloses the supplied text. The origin's x and y maybe negative, meaning that the glyphs in the text extending left of x or above y. .PP The first rectangle is the bounding box required for a container that wants to contain the text. The second box is only useful if an optional angle is provided. This second rectangle is the bounding box of the un-rotated text that allows for a controlled rotation. If no angle is supplied then the two rectangles are actually the same object. .PP If the optional angle is supplied the text will be rotated by the supplied amount in radians. .SS "get_textbox_layout ($tb)" .IX Subsection "get_textbox_layout ($tb)" Returns a Graphics::Primitive::Driver::TextLayout for the supplied textbox. .SS "reset" .IX Subsection "reset" Reset the driver. .SS "draw" .IX Subsection "draw" Draws the specified component. Container's components are drawn recursively. .SH "ACKNOWLEDGEMENTS" .IX Header "ACKNOWLEDGEMENTS" Danny Luna .SH "AUTHOR" .IX Header "AUTHOR" Cory G Watson .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2016 by Cold Hard Code, \s-1LLC.\s0 .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.