SVGSurface.this - multiple declarations

Function SVGSurface.this

Create a SVGSurface from a existing cairo_surface_t*. SVGSurface is a garbage collected class. It will call cairo_surface_destroy when it gets collected by the GC or when dispose() is called.

Prototype

this(
  cairo_surface_t* ptr
);

Warning

ptr's reference count is not increased by this function! Adjust reference count before calling it if necessary

Only use this if you know what your doing! This function should not be needed for standard cairoD usage.

Function SVGSurface.this

Creates a SVG surface of the specified size in points to be written to filename.

The SVG surface backend recognizes the following MIME types for the data attached to a surface (see Surface.setMimeData()) when it is used as a source pattern for drawing on this surface: CAIRO_MIME_TYPE_JPEG, CAIRO_MIME_TYPE_PNG, CAIRO_MIME_TYPE_URI. If any of them is specified, the SVG backend emits a href with the content of MIME data instead of a surface snapshot (PNG, Base64-encoded) in the corresponding image tag.

The unofficial MIME type CAIRO_MIME_TYPE_URI is examined first. If present, the URI is emitted as is: assuring the correctness of URI is left to the client code.

If CAIRO_MIME_TYPE_URI is not present, but CAIRO_MIME_TYPE_JPEG or CAIRO_MIME_TYPE_PNG is specified, the corresponding data is Base64-encoded and emitted.

Prototype

this(
  string fileName,
  double width,
  double height
);

Parameters

NameDescription
width width of the surface, in points (1 point == 1/72.0 inch)
height height of the surface, in points (1 point == 1/72.0 inch)

Function SVGSurface.this

Creates a SVG surface of the specified size in points. This will generate a SVG surface that may be queried and used as a source, without generating a temporary file.

The SVG surface backend recognizes the following MIME types for the data attached to a surface (see Surface.setMimeData()) when it is used as a source pattern for drawing on this surface: CAIRO_MIME_TYPE_JPEG, CAIRO_MIME_TYPE_PNG, CAIRO_MIME_TYPE_URI. If any of them is specified, the SVG backend emits a href with the content of MIME data instead of a surface snapshot (PNG, Base64-encoded) in the corresponding image tag.

The unofficial MIME type CAIRO_MIME_TYPE_URI is examined first. If present, the URI is emitted as is: assuring the correctness of URI is left to the client code.

If CAIRO_MIME_TYPE_URI is not present, but CAIRO_MIME_TYPE_JPEG or CAIRO_MIME_TYPE_PNG is specified, the corresponding data is Base64-encoded and emitted.

Prototype

this(
  double width,
  double height
);

Parameters

NameDescription
width width of the surface, in points (1 point == 1/72.0 inch)
height height of the surface, in points (1 point == 1/72.0 inch)

Authors

Johannes Pfau cairoD
cairo team cairo

Copyright

License

cairoD wrapper/bindings Boost License 1.0
cairo LGPL 2.1 / MPL 1.1