Free a Cairo.Context and all associated memory
Unlike other objects in GJS, Cairo contexts must be explicitly disposed to avoid memory leaks.
Adds a circular arc of the given radius to the current path
X coordinate of the center of the arc
Y coordinate of the center of the arc
Radius of the arc
Starting angle in radians
End angle in radians
Adds a circular arc of the given radius to the current path, but draws the arc in the opposite direction from arc()
X coordinate of the center of the arc
Y coordinate of the center of the arc
Radius of the arc
Starting angle in radians
End angle in radians
Establishes a new clip region by intersecting the current clip region with the current path, then clearing the current path
Returns the current clip extents as [x1, y1, x2, y2]
An array with [x1, y1, x2, y2] clip extents
Like clip() but preserves the current path
Closes the current path by drawing a line to the beginning of the current subpath
Emits the current page, but doesn't clear it
Adds a cubic Bézier spline to the current path
X coordinate of the first control point
Y coordinate of the first control point
X coordinate of the second control point
Y coordinate of the second control point
X coordinate of the end point
Y coordinate of the end point
Transforms a coordinate from device space to user space
X coordinate
Y coordinate
An array with [x, y] transformed coordinates
Transforms a distance vector from device space to user space
X component of the distance vector
Y component of the distance vector
An array with [x, y] transformed distance vector
Fills the current path using the current fill rule, then clears the path
Returns the current fill extents as [x1, y1, x2, y2]
An array with [x1, y1, x2, y2] fill extents
Fills the current path using the current fill rule, but doesn't clear the path
Gets the current antialiasing mode
The current antialiasing mode
Gets the current point of the current path
An array with [x, y] coordinates of the current point
Gets the current dash count
The number of elements in the current dash pattern
Gets the current fill rule
The current fill rule
Gets the font extents for the currently selected font
Font extents in user-space coordinates
Gets the current line cap style
The current line cap style
Gets the current line join style
The current line join style
Gets the current line width
The current line width
Gets the current miter limit
The current miter limit
Gets the current compositing operator
The current compositing operator
Gets the current tolerance value
The current tolerance value
Computes the extents of an array of glyphs in user-space coordinates
Extents as [x_bearing, y_bearing, width, height, x_advance, y_advance]
Checks if there is a current point defined
True if there is a current point
Resets the current transformation matrix to the identity matrix
Tests whether the given point is inside the area filled by the current path
X coordinate of the point to test
Y coordinate of the point to test
True if the point is inside the path
Tests whether the given point is inside the area that would be inked by the current path with the current line width and stroke parameters
X coordinate of the point to test
Y coordinate of the point to test
True if the point would be inked
Adds a line to the current path from the current point to the given point
X coordinate of the end point
Y coordinate of the end point
Begins a new subpath at the given point
X coordinate of the new position
Y coordinate of the new position
Clears the current path and begins a new path
Begins a new subpath without changing the current point
Paints the current source everywhere within the current clip region
Paints the current source everywhere within the current clip region using the given alpha value
Alpha value to use, between 0 and 1
Returns the current path extents as [x1, y1, x2, y2]
An array with [x1, y1, x2, y2] path extents
Terminates the current pattern group and makes it the current source pattern
Temporarily redirects drawing to an intermediate surface
Temporarily redirects drawing to an intermediate surface with the given content
The content type for the group
Adds a rectangle to the current path
X coordinate of the top-left corner
Y coordinate of the top-left corner
Width of the rectangle
Height of the rectangle
Adds a cubic Bézier spline to the current path using relative coordinates
X offset to the first control point from current point
Y offset to the first control point from current point
X offset to the second control point from current point
Y offset to the second control point from current point
X offset to the end point from current point
Y offset to the end point from current point
Adds a line to the current path relative to the current point
X offset from the current point
Y offset from the current point
Begins a new subpath relative to the current point
X offset from the current point
Y offset from the current point
Resets the current clip region to its original, unrestricted state
Restores the context state from the stack
Rotates the current transformation matrix
Angle of rotation in radians
Saves the current context state to the stack
Scales the current transformation matrix
Scale factor for the X dimension
Scale factor for the Y dimension
Selects a font face
A font family name
A font slant
A font weight
Sets the antialiasing mode
The new antialiasing mode
Sets the dash pattern to be used by stroke()
Array of dash lengths
Offset into the dash pattern
Sets the current fill rule
The new fill rule
Sets the current font size in user space units
Font size in user space units
Sets the current line cap style
The new line cap style
Sets the current line join style
The new line join style
Sets the current line width
The new line width
Sets the current miter limit
The new miter limit
Sets the current compositing operator
The new compositing operator
Sets the source pattern to an RGB opaque color
Red component, between 0 and 1
Green component, between 0 and 1
Blue component, between 0 and 1
Sets the source pattern to an RGBA color
Red component, between 0 and 1
Green component, between 0 and 1
Blue component, between 0 and 1
Alpha component, between 0 and 1
Sets the tolerance used when converting paths to trapezoids
The new tolerance value
Emits the current page and clears it
Draws text at the current position
A string of text encoded in UTF-8
Renders glyphs with embedded text and cluster mapping (e.g. for PDF/PS)
UTF-8 text string
Array of glyphs
Cluster mapping (bytes to glyphs)
Direction of cluster mapping
Strokes the current path using the current line width, line join, line cap, and dash settings, then clears the path
Returns the current stroke extents as [x1, y1, x2, y2]
An array with [x1, y1, x2, y2] stroke extents
Like stroke() but preserves the current path
Gets the extents of the given text if it were drawn at the current point
A string of text encoded in UTF-8
Text extents information
Translates the current transformation matrix
Translation in the X direction
Translation in the Y direction
Transforms a coordinate from user space to device space
X coordinate
Y coordinate
An array with [x, y] transformed coordinates
Transforms a distance vector from user space to device space
X component of the distance vector
Y component of the distance vector
An array with [x, y] transformed distance vector
The main Cairo drawing context
A Cairo context is used to draw to surfaces and perform drawing operations. When you're done with a context, you must call $dispose() to free memory.