Use the specified unit for the width and height of the generated SVG file. See #cairo_svg_unit_t for a list of available unit values that can be used here.

cairo_svg_surface_set_document_unit(surface, unit)

Arguments

surface

[cairo_surface_t *] a SVG #cairo_surface_t

unit

[int] SVG unit

Details

This function can be called at any time before generating the SVG file.

However to minimize the risk of ambiguities it's recommended to call it before any drawing operations have been performed on the given surface, to make it clearer what the unit used in the drawing operations is.

The simplest way to do this is to call this function immediately after creating the SVG surface.

Note if this function is never called, the default unit for SVG documents generated by cairo will be "pt". This is for historical reasons.

Since: 1.16

C function prototype: void cairo_svg_surface_set_document_unit (cairo_surface_t *surface, cairo_svg_unit_t unit)

See also