Method Cairo.SVGSurface()->set_document_unit()


Method set_document_unit

void set_document_unit(int unit)

Description

Use the specified unit for the width and height of the generated SVG file.

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 user unit.

Parameter unit

SVG unit