Finishes the surface and drops all references to external resources
Performs all pending drawing operations
Returns user data attached to the surface (C API: cairo_surface_get_user_data)
Key used when setting the data
The attached data or null
Gets the device offset of the surface
An array with [x, y] device offset
Gets the device scale of the surface
An array with [x, y] device scale
Surface type (image, PDF, PostScript, SVG, …) — the runtime kind regardless of static class.
Source: gjs/modules/cairo-surface.cpp getType_func.
Attaches user data to the surface (C API: cairo_surface_set_user_data)
Key for the user data
Data to attach
Optionaldestroy: (data: unknown) => voidOptional callback when the surface is destroyed or data is replaced
Sets the device offset of the surface
X offset
Y offset
Sets the device scale of the surface
X scale factor
Y scale factor
Write the surface's contents out to a PNG file. Only meaningful for image-backed surfaces (returns CAIRO_STATUS_WRITE_ERROR on non-image surfaces).
Source: gjs/modules/cairo-surface.cpp writeToPNG_func.
Output PNG path
Base class for all Cairo surfaces