1Cairo(3)              User Contributed Perl Documentation             Cairo(3)
2
3
4

NAME

6       Cairo - Perl interface to the cairo 2d vector graphics library
7

SYNOPSIS

9         use Cairo;
10
11         my $surface = Cairo::ImageSurface->create ('argb32', 100, 100);
12         my $cr = Cairo::Context->create ($surface);
13
14         $cr->rectangle (10, 10, 40, 40);
15         $cr->set_source_rgb (0, 0, 0);
16         $cr->fill;
17
18         $cr->rectangle (50, 50, 40, 40);
19         $cr->set_source_rgb (1, 1, 1);
20         $cr->fill;
21
22         $cr->show_page;
23
24         $surface->write_to_png ('output.png');
25

ABSTRACT

27       Cairo provides Perl bindings for the vector graphics library cairo.  It
28       supports multiple output targets, including PNG, PDF and SVG.  Cairo
29       produces identical output on all those targets.
30

API DOCUMENTATION

32       This is a listing of the API Cairo provides.  For more verbose
33       information, refer to the cairo manual at
34       <http://cairographics.org/manual/>.
35
36   Drawing
37       Cairo::Context -- The cairo drawing context
38
39       Cairo::Context is the main object used when drawing with Cairo. To draw
40       with Cairo, you create a Cairo::Context, set the target surface, and
41       drawing options for the Cairo::Context, create shapes with methods like
42       "$cr->move_to" and "$cr->line_to", and then draw shapes with
43       "$cr->stroke" or "$cr->fill".
44
45       Cairo::Context's can be pushed to a stack via "$cr->save". They may
46       then safely be changed, without loosing the current state. Use
47       "$cr->restore" to restore to the saved state.
48
49       $cr = Cairo::Context->create ($surface)
50           $surface: Cairo::Surface
51       $cr->save
52       $cr->restore
53       $status = $cr->status
54       $surface = $cr->get_target
55       $cr->push_group [1.2]
56       $cr->push_group_with_content ($content) [1.2]
57           $content: Cairo::Content
58       $pattern = $cr->pop_group [1.2]
59       $cr->pop_group_to_source [1.2]
60       $surface = $cr->get_group_target [1.2]
61       $cr->set_source_rgb ($red, $green, $blue)
62           $red: double
63           $green: double
64           $blue: double
65       $cr->set_source_rgba ($red, $green, $blue, $alpha)
66           $red: double
67           $green: double
68           $blue: double
69           $alpha: double
70       $cr->set_source ($source)
71           $source: Cairo::Pattern
72       $cr->set_source_surface ($surface, $x, $y)
73           $surface: Cairo::Surface
74           $x: double
75           $y: double
76       $source = $cr->get_source
77       $cr->set_antialias ($antialias)
78           $antialias: Cairo::Antialias
79       $antialias = $cr->get_antialias
80       $cr->set_dash ($offset, ...)
81           $offset: double
82           ...: list of doubles
83       $cr->set_fill_rule ($fill_rule)
84           $fill_rule: Cairo::FillRule
85       $fill_rule = $cr->get_fill_rule
86       $cr->set_line_cap ($line_cap)
87           $line_cap: Cairo::LineCap
88       $line_cap = $cr->get_line_cap
89       $cr->set_line_join ($line_join)
90           $line_join: Cairo::LineJoin
91       $line_join = $cr->get_line_join
92       $cr->set_line_width ($width)
93           $width: double
94       $width = $cr->get_line_width
95       $cr->set_miter_limit ($limit)
96           $limit: double
97       ($offset, @dashes) = $cr->get_dash [1.4]
98       $limit = $cr->get_miter_limit
99       $cr->set_operator ($op)
100           $op: Cairo::Operator
101       $op = $cr->get_operator
102       $cr->set_tolerance ($tolerance)
103           $tolerance: double
104       $tolerance = $cr->get_tolerance
105       $cr->clip
106       $cr->clip_preserve
107       ($x1, $y1, $x2, $y2) = $cr->clip_extents [1.4]
108       $bool = $cr->in_clip ($x, $y) [1.10]
109           $x: double
110           $y: double
111       @rectangles = $cr->copy_clip_rectangle_list [1.4]
112       $cr->reset_clip
113       $cr->fill
114       $cr->fill_preserve
115       ($x1, $y1, $x2, $y2) = $cr->fill_extents
116       $bool = $cr->in_fill ($x, $y)
117           $x: double
118           $y: double
119       $cr->mask ($pattern)
120           $pattern: Cairo::Pattern
121       $cr->mask_surface ($surface, $surface_x, $surface_y)
122           $surface: Cairo::Surface
123           $surface_x: double
124           $surface_y: double
125       $cr->paint
126       $cr->paint_with_alpha ($alpha)
127           $alpha: double
128       $cr->stroke
129       $cr->stroke_preserve
130       ($x1, $y1, $x2, $y2) = $cr->stroke_extents
131       $bool = $cr->in_stroke ($x, $y)
132           $x: double
133           $y: double
134       $cr->tag_begin($name, $atts) [1.16]
135           $name: string
136           $atts: string
137       $cr->tag_end($name) [1.16]
138           $name: string
139       Predefined names:
140           Cairo::TAG_DEST [1.16]
141           Cairo::TAG_LINK [1.16]
142       $cr->copy_page
143       $cr->show_page
144
145       Paths -- Creating paths and manipulating path data
146
147         $path = [
148           { type => "move-to", points => [[1, 2]] },
149           { type => "line-to", points => [[3, 4]] },
150           { type => "curve-to", points => [[5, 6], [7, 8], [9, 10]] },
151           ...
152           { type => "close-path", points => [] },
153         ];
154
155       Cairo::Path is a data structure for holding a path. This data structure
156       serves as the return value for "$cr->copy_path" and
157       "$cr->copy_path_flat" as well the input value for "$cr->append_path".
158
159       Cairo::Path is represented as an array reference that contains path
160       elements, represented by hash references with two keys: type and
161       points.  The value for type can be either of the following:
162
163       "move-to"
164       "line-to"
165       "curve-to"
166       "close-path"
167
168       The value for points is an array reference which contains zero or more
169       points.  Points are represented as array references that contain two
170       doubles: x and y.  The necessary number of points depends on the type
171       of the path element:
172
173       "move-to": 1 point
174       "line_to": 1 point
175       "curve-to": 3 points
176       "close-path": 0 points
177
178       The semantics and ordering of the coordinate values are consistent with
179       "$cr->move_to", "$cr->line_to", "$cr->curve_to", and "$cr->close_path".
180
181       Note that the paths returned by Cairo are implemented as tied array
182       references which do not support adding, removing or shuffling of path
183       segments.  For these operations, you need to make a shallow copy first:
184
185         my @path_clone = @{$path};
186         # now you can alter @path_clone which ever way you want
187
188       The points of a single path element can be changed directly, however,
189       without the need for a shallow copy:
190
191         $path->[$i]{points} = [[3, 4], [5, 6], [7, 8]];
192
193       $path = $cr->copy_path
194       $path = $cr->copy_path_flat
195       $cr->append_path ($path)
196           $path: Cairo::Path
197       $bool = $cr->has_current_point [1.6]
198       ($x, $y) = $cr->get_current_point
199       $cr->new_path
200       $cr->new_sub_path [1.2]
201       $cr->close_path
202       ($x1, $y1, $x2, $y2) = $cr->path_extents [1.6]
203       $cr->arc ($xc, $yc, $radius, $angle1, $angle2)
204           $xc: double
205           $yc: double
206           $radius: double
207           $angle1: double
208           $angle2: double
209       $cr->arc_negative ($xc, $yc, $radius, $angle1, $angle2)
210           $xc: double
211           $yc: double
212           $radius: double
213           $angle1: double
214           $angle2: double
215       $cr->curve_to ($x1, $y1, $x2, $y2, $x3, $y3)
216           $x1: double
217           $y1: double
218           $x2: double
219           $y2: double
220           $x3: double
221           $y3: double
222       $cr->line_to ($x, $y)
223           $x: double
224           $y: double
225       $cr->move_to ($x, $y)
226           $x: double
227           $y: double
228       $cr->rectangle ($x, $y, $width, $height)
229           $x: double
230           $y: double
231           $width: double
232           $height: double
233       $cr->glyph_path (...)
234           ...: list of Cairo::Glyph's
235       $cr->text_path ($utf8)
236           $utf8: string in utf8 encoding
237       $cr->rel_curve_to ($dx1, $dy1, $dx2, $dy2, $dx3, $dy3)
238           $dx1: double
239           $dy1: double
240           $dx2: double
241           $dy2: double
242           $dx3: double
243           $dy3: double
244       $cr->rel_line_to ($dx, $dy)
245           $dx: double
246           $dy: double
247       $cr->rel_move_to ($dx, $dy)
248           $dx: double
249           $dy: double
250
251       Patterns -- Gradients and filtered sources
252
253       $status = $pattern->status
254       $type = $pattern->get_type [1.2]
255       $pattern->set_extend ($extend)
256           $extend: Cairo::Extend
257       $extend = $pattern->get_extend
258       $pattern->set_filter ($filter)
259           $filter: Cairo::Filter
260       $filter = $pattern->get_filter
261       $pattern->set_matrix ($matrix)
262           $matrix: Cairo::Matrix
263       $matrix = $pattern->get_matrix
264       $pattern = Cairo::SolidPattern->create_rgb ($red, $green, $blue)
265           $red: double
266           $green: double
267           $blue: double
268       $pattern = Cairo::SolidPattern->create_rgba ($red, $green, $blue,
269       $alpha)
270           $red: double
271           $green: double
272           $blue: double
273           $alpha: double
274       ($r, $g, $b, $a) = $pattern->get_rgba [1.4]
275       $pattern = Cairo::SurfacePattern->create ($surface)
276           $surface: Cairo::Surface
277       $surface = $pattern->get_surface [1.4]
278       $pattern = Cairo::LinearGradient->create ($x0, $y0, $x1, $y1)
279           $x0: double
280           $y0: double
281           $x1: double
282           $y1: double
283       ($x0, $y0, $x1, $y1) = $pattern->get_points [1.4]
284       $pattern = Cairo::RadialGradient->create ($cx0, $cy0, $radius0, $cx1,
285       $cy1, $radius1)
286           $cx0: double
287           $cy0: double
288           $radius0: double
289           $cx1: double
290           $cy1: double
291           $radius1: double
292       ($x0, $y0, $r0, $x1, $y1, $r1) = $pattern->get_circles [1.4]
293       $pattern->add_color_stop_rgb ($offset, $red, $green, $blue)
294           $offset: double
295           $red: double
296           $green: double
297           $blue: double
298       $pattern->add_color_stop_rgba ($offset, $red, $green, $blue, $alpha)
299           $offset: double
300           $red: double
301           $green: double
302           $blue: double
303           $alpha: double
304       @stops = $pattern->get_color_stops [1.4]
305           A color stop is represented as an array reference with five
306           elements: offset, red, green, blue, and alpha.
307
308       Regions -- Representing a pixel-aligned area
309
310       $region = Cairo::Region->create (...) [1.10]
311           ...: zero or more Cairo::RectangleInt
312       $status = $region->status [1.10]
313       $num = $region->num_rectangles [1.10]
314       $rect = $region->get_rectangle ($i) [1.10]
315           $i: integer
316       $bool = $region->is_empty [1.10]
317       $bool = $region->contains_point ($x, $y) [1.10]
318           $x: integer
319           $y: integer
320       $bool = $region_one->equal ($region_two) [1.10]
321           $region_two: Cairo::Region
322       $region->translate ($dx, $dy) [1.10]
323           $dx: integer
324           $dy: integer
325       $status = $dst->intersect ($other) [1.10]
326       $status = $dst->intersect_rectangle ($rect) [1.10]
327       $status = $dst->subtract ($other) [1.10]
328       $status = $dst->subtract_rectangle ($rect) [1.10]
329       $status = $dst->union ($other) [1.10]
330       $status = $dst->union_rectangle ($rect) [1.10]
331       $status = $dst->xor ($other) [1.10]
332       $status = $dst->xor_rectangle ($rect) [1.10]
333           $other: Cairo::Region
334           $rect: Cairo::RectangleInt
335
336       Transformations -- Manipulating the current transformation matrix
337
338       $cr->translate ($tx, $ty)
339           $tx: double
340           $ty: double
341       $cr->scale ($sx, $sy)
342           $sx: double
343           $sy: double
344       $cr->rotate ($angle)
345           $angle: double
346       $cr->transform ($matrix)
347           $matrix: Cairo::Matrix
348       $cr->set_matrix ($matrix)
349           $matrix: Cairo::Matrix
350       $matrix = $cr->get_matrix
351       $cr->identity_matrix
352       ($x, $y) = $cr->user_to_device ($x, $y)
353           $x: double
354           $y: double
355       ($dx, $dy) = $cr->user_to_device_distance ($dx, $dy)
356           $dx: double
357           $dy: double
358       ($x, $y) = $cr->device_to_user ($x, $y)
359           $x: double
360           $y: double
361       ($dx, $dy) = $cr->device_to_user_distance ($dx, $dy)
362           $dx: double
363           $dy: double
364
365       Text -- Rendering text and sets of glyphs
366
367       Glyphs are represented as anonymous hash references with three keys:
368       index, x and y.  Example:
369
370         my @glyphs = ({ index => 1, x => 2, y => 3 },
371                       { index => 2, x => 3, y => 4 },
372                       { index => 3, x => 4, y => 5 });
373
374       $cr->select_font_face ($family, $slant, $weight)
375           $family: string
376           $slant: Cairo::FontSlant
377           $weight: Cairo::FontWeight
378       $cr->set_font_size ($size)
379           $size: double
380       $cr->set_font_matrix ($matrix)
381           $matrix: Cairo::Matrix
382       $matrix = $cr->get_font_matrix
383       $cr->set_font_options ($options)
384           $options: Cairo::FontOptions
385       $options = $cr->get_font_options
386       $cr->set_scaled_font ($scaled_font) [1.2]
387           $scaled_font: Cairo::ScaledFont
388       $scaled_font = $cr->get_scaled_font [1.4]
389       $cr->show_text ($utf8)
390           $utf8: string
391       $cr->show_glyphs (...)
392           ...: list of glyphs
393       $cr->show_text_glyphs ($utf8, $glyphs, $clusters, $cluster_flags) [1.8]
394           $utf8: string
395           $glyphs: array ref of glyphs
396           $clusters: array ref of clusters
397           $cluster_flags: Cairo::TextClusterFlags
398       $face = $cr->get_font_face
399       $extents = $cr->font_extents
400       $cr->set_font_face ($font_face)
401           $font_face: Cairo::FontFace
402       $cr->set_scaled_font ($scaled_font)
403           $scaled_font: Cairo::ScaledFont
404       $extents = $cr->text_extents ($utf8)
405           $utf8: string
406       $extents = $cr->glyph_extents (...)
407           ...: list of glyphs
408       $face = Cairo::ToyFontFace->create ($family, $slant, $weight) [1.8]
409           $family: string
410           $slant: Cairo::FontSlant
411           $weight: Cairo::FontWeight
412       $family = $face->get_family [1.8]
413       $slang = $face->get_slant [1.8]
414       $weight = $face->get_weight [1.8]
415
416   Fonts
417       Cairo::FontFace -- Base class for fonts
418
419       $status = $font_face->status
420       $type = $font_face->get_type [1.2]
421
422       Scaled Fonts -- Caching metrics for a particular font size
423
424       $scaled_font = Cairo::ScaledFont->create ($font_face, $font_matrix,
425       $ctm, $options)
426           $font_face: Cairo::FontFace
427           $font_matrix: Cairo::Matrix
428           $ctm: Cairo::Matrix
429           $options: Cairo::FontOptions
430       $status = $scaled_font->status
431       $extents = $scaled_font->extents
432       $extents = $scaled_font->text_extents ($utf8) [1.2]
433           $utf8: string
434       $extents = $scaled_font->glyph_extents (...)
435           ...: list of glyphs
436       ($status, $glyphs, $clusters, $cluster_flags) =
437       $scaled_font->text_to_glyphs ($x, $y, $utf8) [1.8]
438           $x: double
439           $y: double
440           $utf8: string
441       $font_face = $scaled_font->get_font_face [1.2]
442       $options = $scaled_font->get_font_options [1.2]
443       $font_matrix = $scaled_font->get_font_matrix [1.2]
444       $ctm = $scaled_font->get_ctm [1.2]
445       $scale_matrix = $scaled_font->get_scale_matrix [1.8]
446       $type = $scaled_font->get_type [1.2]
447
448       Font Options -- How a font should be rendered
449
450       $font_options = Cairo::FontOptions->create
451       $status = $font_options->status
452       $font_options->merge ($other)
453           $other: Cairo::FontOptions
454       $hash = $font_options->hash
455       $bools = $font_options->equal ($other)
456           $other: Cairo::FontOptions
457       $font_options->set_antialias ($antialias)
458           $antialias: Cairo::AntiAlias
459       $antialias = $font_options->get_antialias
460       $font_options->set_subpixel_order ($subpixel_order)
461           $subpixel_order: Cairo::SubpixelOrder
462       $subpixel_order = $font_options->get_subpixel_order
463       $font_options->set_hint_style ($hint_style)
464           $hint_style: Cairo::HintStyle
465       $hint_style = $font_options->get_hint_style
466       $font_options->set_hint_metrics ($hint_metrics)
467           $hint_metrics: Cairo::HintMetrics
468       $hint_metrics = $font_options->get_hint_metrics
469
470       FreeType Fonts -- Font support for FreeType
471
472       If your cairo library supports it, the FreeType integration allows you
473       to load font faces from font files.  You can query for this capability
474       with "Cairo::HAS_FT_FONT".  To actually use this, you'll need the
475       Font::FreeType module.
476
477       my $face = Cairo::FtFontFace->create ($ft_face, $load_flags=0)
478           $ft_face: Font::FreeType::Face
479           $load_flags: integer
480
481           This method allows you to create a Cairo::FontFace from a
482           Font::FreeType::Face.  To obtain the latter, you can for example
483           load it from a file:
484
485             my $file = '/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf';
486             my $ft_face = Font::FreeType->new->face ($file);
487             my $face = Cairo::FtFontFace->create ($ft_face);
488
489   Surfaces
490       Cairo::Surface -- Base class for surfaces
491
492       $similar = Cairo::Surface->create_similar ($other, $content, $width,
493       $height)
494           $other: Cairo::Surface
495           $content: Cairo::Content
496           $width: integer
497           $height: integer
498
499           For hysterical reasons, you can also use the following syntax:
500
501             $similar = $other->create_similar ($content, $width, $height)
502
503       $new = Cairo::Surface->create_for_rectangle ($target, $x, $y, $width,
504       $height) [1.10]
505           $target: Cairo::Surface
506           $x: double
507           $y: double
508           $width: double
509           $height: double
510       $status = $surface->status
511       $surface->finish
512       $surface->flush
513       $font_options = $surface->get_font_options
514       $content = $surface->get_content [1.2]
515       $surface->mark_dirty
516       $surface->mark_dirty_rectangle ($x, $y, $width, $height)
517           $x: integer
518           $y: integer
519           $width: integer
520           $height: integer
521       $surface->set_device_offset ($x_offset, $y_offset)
522           $x_offset: integer
523           $y_offset: integer
524       ($x_offset, $y_offset) = $surface->get_device_offset [1.2]
525       $surface->set_fallback_resolution ($x_pixels_per_inch,
526       $y_pixels_per_inch) [1.2]
527           $x_pixels_per_inch: double
528           $y_pixels_per_inch: double
529       ($x_pixels_per_inch, $y_pixels_per_inch) =
530       $surface->get_fallback_resolution [1.8]
531       $type = $surface->get_type [1.2]
532       $surface->set_mime_data ($mime_type, $mime_data) [1.10]
533       $mime_data = $surface->get_mime_data ($mime_type) [1.10]
534       $bool = $surface->supports_mime_type ($mime_type) [1.12]
535           $mime_type: string
536               Predefined MIME types:
537                   Cairo::Surface::MIME_TYPE_JP2 [1.10]
538                   Cairo::Surface::MIME_TYPE_JPEG [1.10]
539                   Cairo::Surface::MIME_TYPE_PNG [1.10]
540                   Cairo::Surface::MIME_TYPE_URI [1.10]
541                   Cairo::Surface::MIME_TYPE_UNIQUE_ID [1.12]
542                   Cairo::Surface::MIME_TYPE_JBIG2 [1.14]
543                   Cairo::Surface::MIME_TYPE_JBIG2_GLOBAL [1.14]
544                   Cairo::Surface::MIME_TYPE_JBIG2_GLOBAL_PARAMS [1.14]
545                   Cairo::Surface::MIME_TYPE_CCITT_FAX [1.16]
546                   Cairo::Surface::MIME_TYPE_CCITT_FAX_PARAMS [1.16]
547                   Cairo::Surface::MIME_TYPE_EPS [1.16]
548                   Cairo::Surface::MIME_TYPE_EPS_PARAMS [1.16]
549           $mime_data: binary data string
550       $status = $surface->copy_page [1.6]
551           $status: Cairo::Status
552       $status = $surface->show_page [1.6]
553           $status: Cairo::Status
554       $boolean = $surface->has_show_text_glyphs [1.8]
555
556       Image Surfaces -- Rendering to memory buffers
557
558       $surface = Cairo::ImageSurface->create ($format, $width, $height)
559           $format: Cairo::Format
560           $width: integer
561           $height: integer
562       $surface = Cairo::ImageSurface->create_for_data ($data, $format,
563       $width, $height, $stride)
564           $data: image data
565           $format: Cairo::Format
566           $width: integer
567           $height: integer
568           $stride: integer
569       $data = $surface->get_data [1.2]
570       $format = $surface->get_format [1.2]
571       $width = $surface->get_width
572       $height = $surface->get_height
573       $stride = $surface->get_stride [1.2]
574       $stride = Cairo::Format::stride_for_width ($format, $width) [1.6]
575           $format: Cairo::Format
576           $width: integer
577
578       PDF Surfaces -- Rendering PDF documents
579
580       $surface = Cairo::PdfSurface->create ($filename, $width_in_points,
581       $height_in_points) [1.2]
582           $filename: string
583           $width_in_points: double
584           $height_in_points: double
585       $surface = Cairo::PdfSurface->create_for_stream ($callback,
586       $callback_data, $width_in_points, $height_in_points) [1.2]
587           $callback: Cairo::WriteFunc
588           $callback_data: scalar
589           $width_in_points: double
590           $height_in_points: double
591       $surface->set_size ($width_in_points, $height_in_points) [1.2]
592           $width_in_points: double
593           $height_in_points: double
594       $surface->restrict_to_version ($version) [1.10]
595           $version: Cairo::PdfVersion
596       @versions = Cairo::PdfSurface::get_versions [1.10]
597       $string = Cairo::PdfSurface::version_to_string ($version) [1.10]
598           $version: Cairo::PdfVersion
599       $item_id = $surface->add_outline($parent_id, $name, $attributes,
600       $flags) [1.16]
601           $item_id: int, item ID
602           $parent_id: parent item id or Cairo::PdfSurface::OUTLINE_ROOT
603           $name: string, item display
604           $attributes: string, item attributes
605           $flags: list reference, item flags
606       $surface->set_metadata($name, $value) [1.16]
607           $name: string
608           $value: string
609       $surface->set_page_label($label) [1.16]
610           $label: string, page label
611       $surface->set_thumbnail_size($width, $height) [1.16]
612           $width: int, thumbnail width
613           $height: int, thumbnail height
614
615       PNG Support -- Reading and writing PNG images
616
617       $surface = Cairo::ImageSurface->create_from_png ($filename)
618           $filename: string
619       Cairo::ReadFunc: $data = sub { my ($callback_data, $length) = @_; }
620           $data: binary image data, of length $length
621           $callback_data: scalar, user data
622           $length: integer, bytes to read
623       $surface = Cairo::ImageSurface->create_from_png_stream ($callback,
624       $callback_data)
625           $callback: Cairo::ReadFunc
626           $callback_data: scalar
627       $status = $surface->write_to_png ($filename)
628           $filename: string
629       Cairo::WriteFunc: sub { my ($callback_data, $data) = @_; }
630           $callback_data: scalar, user data
631           $data: binary image data, to be written
632       $status = $surface->write_to_png_stream ($callback, $callback_data)
633           $callback: Cairo::WriteFunc
634           $callback_data: scalar
635
636       PostScript Surfaces -- Rendering PostScript documents
637
638       $surface = Cairo::PsSurface->create ($filename, $width_in_points,
639       $height_in_points) [1.2]
640           $filename: string
641           $width_in_points: double
642           $height_in_points: double
643       $surface = Cairo::PsSurface->create_for_stream ($callback,
644       $callback_data, $width_in_points, $height_in_points) [1.2]
645           $callback: Cairo::WriteFunc
646           $callback_data: scalar
647           $width_in_points: double
648           $height_in_points: double
649       $surface->set_size ($width_in_points, $height_in_points) [1.2]
650           $width_in_points: double
651           $height_in_points: double
652       $surface->dsc_begin_setup [1.2]
653       $surface->dsc_begin_page_setup [1.2]
654       $surface->dsc_comment ($comment) [1.2]
655           $comment: string
656       $surface->restrict_to_level ($level) [1.6]
657           $level: Cairo::PsLevel
658       @levels = Cairo::PsSurface::get_levels [1.6]
659       $string = Cairo::PsSurface::level_to_string ($level) [1.6]
660           $level: Cairo::PsLevel
661       $surface->set_eps ($eps) [1.6]
662           $eps: boolean
663       $eps = $surface->get_eps [1.6]
664
665       Recording Surfaces -- Records all drawing operations
666
667       $surface = Cairo::RecordingSurface->create ($content, $extents) [1.10]
668           $content: Cairo::Content
669           $extents: Cairo::Rectangle
670       ($x0, $y0, $width, $height) = $surface->ink_extents [1.10]
671       $extents_ref = $surface->get_extents [1.12]
672           $extents_ref: Cairo::Rectangle reference
673
674       SVG Surfaces -- Rendering SVG documents
675
676       $surface = Cairo::SvgSurface->create ($filename, $width_in_points,
677       $height_in_points) [1.2]
678           $filename: string
679           $width_in_points: double
680           $height_in_points: double
681       $surface = Cairo::SvgSurface->create_for_stream ($callback,
682       $callback_data, $width_in_points, $height_in_points) [1.2]
683           $callback: Cairo::WriteFunc
684           $callback_data: scalar
685           $width_in_points: double
686           $height_in_points: double
687       $surface->restrict_to_version ($version) [1.2]
688           $version: Cairo::SvgVersion
689       @versions = Cairo::SvgSurface::get_versions [1.2]
690       $string = Cairo::SvgSurface::version_to_string ($version) [1.2]
691           $version: Cairo::SvgVersion
692
693   Utilities
694       Version Information -- Run-time and compile-time version checks.
695
696       $version_code = Cairo->lib_version
697       $version_string = Cairo->lib_version_string
698           These two functions return the version of libcairo that the program
699           is currently running against.
700
701       $version_code = Cairo->LIB_VERSION
702           Returns the version of libcairo that Cairo was compiled against.
703
704       $version_code = Cairo->LIB_VERSION_ENCODE ($major, $minor, $micro)
705           $major: integer
706           $minor: integer
707           $micro: integer
708
709           Encodes the version "$major.$minor.$micro" as an integer suitable
710           for comparison against "Cairo->lib_version" and
711           "Cairo->LIB_VERSION".
712

SEE ALSO

714       <http://cairographics.org/documentation>
715           Lists many available resources including tutorials and examples
716
717       <http://cairographics.org/manual/>
718           Contains the reference manual
719

AUTHORS

721       Ross McFarland <rwmcfa1 at neces dot com>
722       Torsten Schoenfeld <kaffeetisch at gmx dot de>
723
725       Copyright (C) 2004-2013 by the cairo perl team
726
727
728
729perl v5.32.1                      2021-01-26                          Cairo(3)
Impressum