Creates a new #cairo_t with all graphics state parameters set to default values and with target as a target surface. The target surface should be constructed with a backend-specific function such as cairo.global.imageSurfaceCreate (or any other <function>cairo_<emphasis>backend</emphasis>_surface_create(<!-- -->)</function> variant).
Resets all static data within cairo to its original state, (ie. identical to the state at the time of program invocation). For example, all caches within cairo will be flushed empty.
Allocates a new font options object with all options initialized to default values.
This function provides a stride value that will respect all alignment requirements of the accelerated image-rendering code within cairo. Typical usage will be of the form:
Return user data previously attached to cr using the specified key. If no user data has been attached with the given key this function returns null.
Allocates an array of #cairo_glyph_t's. This function is only useful in implementations of #cairo_user_scaled_font_text_to_glyphs_func_t where the user needs to allocate an array of glyphs that cairo will free. For all other uses, user can use their own allocation method for glyphs.
Creates an image surface of the specified format and dimensions. Initially the surface contents are set to 0. (Specifically, within each pixel, each color or alpha channel belonging to format will be 0. The contents of bits within a pixel, but not belonging to the given format are undefined).
Creates a new image surface and initializes the contents to the given PNG file.
Creates a new image surface from PNG data read incrementally via the read_func function.
Get a pointer to the data of the image surface, for direct inspection or modification.
Get the format of the surface.
Get the height of the image surface in pixels.
Get the stride of the image surface in bytes
Get the width of the image surface in pixels.
Begin a patch in a mesh pattern.
Adds a cubic Bézier spline to the current patch from the current point to position (x3, y3) in pattern-space coordinates, using (x1, y1) and (x2, y2) as the control points.
Indicates the end of the current patch in a mesh pattern.
Gets the control point point_num of patch patch_num for a mesh pattern.
Gets the color information in corner corner_num of patch patch_num for a mesh pattern.
Gets the number of patches specified in the given mesh pattern.
Gets path defining the patch patch_num for a mesh pattern.
Adds a line to the current patch from the current point to position (x, y) in pattern-space coordinates.
Define the first point of the current patch in a mesh pattern.
Set an internal control point of the current patch.
Sets the color of a corner of the current patch in a mesh pattern.
Sets the color of a corner of the current patch in a mesh pattern.
Create a new #cairo_pattern_t for the given surface.
Create a new linear gradient #cairo_pattern_t along the line defined by (x0, y0) and (x1, y1). Before using the gradient pattern, a number of color stops should be defined using cairo.pattern.Pattern.addColorStopRgb or cairo.pattern.Pattern.addColorStopRgba.
Create a new mesh pattern.
Creates a new radial gradient #cairo_pattern_t between the two circles defined by (cx0, cy0, radius0) and (cx1, cy1, radius1). Before using the gradient pattern, a number of color stops should be defined using cairo.pattern.Pattern.addColorStopRgb or cairo.pattern.Pattern.addColorStopRgba.
Creates a new user pattern for providing pixel data.
Creates a new #cairo_pattern_t corresponding to an opaque color. The color components are floating point numbers in the range 0 to 1. If the values passed in are outside that range, they will be clamped.
Creates a new #cairo_pattern_t corresponding to a translucent color. The color components are floating point numbers in the range 0 to 1. If the values passed in are outside that range, they will be clamped.
Used to retrieve the list of supported versions. See cairo.global.pdfSurfaceRestrictToVersion.
Add an item to the document outline hierarchy with the name utf8 that links to the location specified by link_attribs. Link attributes have the same keys and values as the [Link Tag]link, excluding the "rect" attribute. The item will be a child of the item with id parent_id. Use CAIRO_PDF_OUTLINE_ROOT as the parent id of top level items.
Creates a PDF surface of the specified size in points to be written to filename.
Creates a PDF surface of the specified size in points to be written incrementally to the stream represented by write_func and closure.
Restricts the generated PDF file to version. See cairo.global.pdfGetVersions for a list of available version values that can be used here.
Set custom document metadata. name may be any string except for the following names reserved by PDF: "Title", "Author", "Subject", "Keywords", "Creator", "Producer", "CreationDate", "ModDate", "Trapped".
Set document metadata. The CAIRO_PDF_METADATA_CREATE_DATE and CAIRO_PDF_METADATA_MOD_DATE values must be in ISO-8601 format: YYYY-MM-DDThh:mm:ss. An optional timezone of the form "[+/-]hh:mm" or "Z" for UTC time can be appended. All other metadata values can be any UTF-8 string.
Set page label for the current page.
Changes the size of a PDF surface for the current (and subsequent) pages.
Set the thumbnail image size for the current and all subsequent pages. Setting a width or height of 0 disables thumbnails for the current and subsequent pages.
Get the string representation of the given version id. This function will return null if version isn't valid. See cairo.global.pdfGetVersions for a way to get the list of valid version ids.
Used to retrieve the list of supported levels. See cairo.global.psSurfaceRestrictToLevel.
Get the string representation of the given level id. This function will return null if level id isn't valid. See cairo.global.psGetLevels for a way to get the list of valid level ids.
Creates a PostScript surface of the specified size in points to be written to filename. See cairo.global.psSurfaceCreateForStream for a more flexible mechanism for handling the PostScript output than simply writing it to a named file.
Creates a PostScript surface of the specified size in points to be written incrementally to the stream represented by write_func and closure. See cairo.global.psSurfaceCreate for a more convenient way to simply direct the PostScript output to a named file.
This function indicates that subsequent calls to cairo.global.psSurfaceDscComment should direct comments to the PageSetup section of the PostScript output.
This function indicates that subsequent calls to cairo.global.psSurfaceDscComment should direct comments to the Setup section of the PostScript output.
Emit a comment into the PostScript output for the given surface.
Check whether the PostScript surface will output Encapsulated PostScript.
Restricts the generated PostSript file to level. See cairo.global.psGetLevels for a list of available level values that can be used here.
If eps is true, the PostScript surface will output Encapsulated PostScript.
Changes the size of a PostScript surface for the current (and subsequent) pages.
Queries the current user data.
Updates the user data that is provided to all callbacks.
Creates a recording-surface which can be used to record all drawing operations at the highest level (that is, the level of paint, mask, stroke, fill and show_text_glyphs). The recording surface can then be "replayed" against any target surface by using it as a source to drawing operations.
Get the extents of the recording-surface.
Measures the extents of the operations stored within the recording-surface. This is useful to compute the required size of an image surface (or equivalent) into which to replay the full sequence of drawing operations.
Allocates a new empty region object.
Allocates a new region object containing rectangle.
Allocates a new region object containing the union of all given rects.
Creates a #cairo_scaled_font_t object from a font face and matrices that describe the size of the font and the environment in which it will be used.
Creates a output device for emitting the script, used when creating the individual surfaces.
Creates a output device for emitting the script, used when creating the individual surfaces.
Converts the record operations in recording_surface into a script.
Queries the script for its current output mode.
Change the output mode of the script
Create a new surface that will emit its rendering through script
Create a pxoy surface that will render to target and record the operations to device.
Emit a string verbatim into the script.
Provides a human-readable description of a #cairo_status_t.
Used to retrieve the list of supported versions. See cairo.global.svgSurfaceRestrictToVersion.
Creates a SVG surface of the specified size in points to be written to filename.
Creates a SVG surface of the specified size in points to be written incrementally to the stream represented by write_func and closure.
Get the unit of the SVG surface.
Restricts the generated SVG file to version. See cairo.global.svgGetVersions for a list of available version values that can be used here.
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.
Get the string representation of the given version id. This function will return null if version isn't valid. See cairo.global.svgGetVersions for a way to get the list of valid version ids.
Adds a new target surface to the list of replicas of a tee surface.
Creates a new "tee" surface.
Retrieves the replica surface at the given index.
Removes the given surface from the list of replicas of a tee surface.
Allocates an array of #cairo_text_cluster_t's. This function is only useful in implementations of #cairo_user_scaled_font_text_to_glyphs_func_t where the user needs to allocate an array of text clusters that cairo will free. For all other uses, user can use their own allocation method for text clusters.
Creates a font face from a triplet of family, slant, and weight. These font faces are used in implementation of the #cairo_t "toy" font API.
Gets the family name of a toy font.
Gets the slant a toy font.
Gets the weight a toy font.
Creates a new user font-face.
Gets the foreground pattern of the glyph currently being rendered. A #cairo_user_scaled_font_render_glyph_func_t function that has been set with cairo.global.userFontFaceSetRenderColorGlyphFunc may call this function to retrieve the current foreground pattern for the glyph being rendered. The function should not be called outside of a cairo.global.userFontFaceSetRenderColorGlyphFunc callback.
Gets the foreground pattern of the glyph currently being rendered. A #cairo_user_scaled_font_render_glyph_func_t function that has been set with cairo.global.userFontFaceSetRenderColorGlyphFunc may call this function to retrieve the current foreground pattern for the glyph being rendered. The function should not be called outside of a cairo.global.userFontFaceSetRenderColorGlyphFunc callback.
Returns the version of the cairo library as a human-readable string of the form "X.Y.Z".
Returns the version of the cairo library encoded in a single integer as per CAIRO_VERSION_ENCODE. The encoding ensures that later versions compare greater than earlier versions.