API Reference / @gtkx/cairo
@gtkx/cairo
Enumerations
| Enumeration | Description |
|---|---|
| Antialias | How shapes and text are antialiased. |
| Content | What a surface holds: color, alpha coverage, or both. |
| DeviceType | The backend behind a device. |
| Extend | What a pattern draws outside its natural area. |
| FillRule | Which areas inside a path a fill covers. |
| Filter | How a pattern is sampled when it is scaled. |
| FontSlant | The slant of a toy font face. |
| FontType | The backend behind a font face or scaled font. |
| FontWeight | The weight of a toy font face. |
| Format | The memory layout of the pixels of an image surface. |
| FtSynthesize | Styles a FreeType font face synthesizes when the font itself lacks them. |
| HintMetrics | Whether font metrics are quantized to integer device units. |
| HintStyle | How much font outlines are fitted to the pixel grid. |
| LineCap | How the ends of a stroked line are rendered. |
| LineJoin | How the corners of a stroked path are rendered. |
| Operator | How a drawing operation composites its source onto the destination. |
| PathDataType | The kind of a segment in a copied path. |
| PatternType | The kind of a pattern. |
| RegionOverlap | How a rectangle relates to a region. |
| Status | The result a cairo object or operation reports; anything but SUCCESS marks the object as errored. |
| SubpixelOrder | The order of color elements within each pixel on a display, for subpixel antialiasing. |
| SurfaceType | The backend behind a surface. |
| TextClusterFlags | Properties of a text cluster mapping. |
Classes
| Class | Description |
|---|---|
| Context | A cairo drawing context (cairo_t): the object every drawing operation goes through, holding the current path, source, transformation, clip and font state for one target surface. GTK hands one to draw callbacks and snapshots, and new Context(surface) creates one for offscreen drawing. |
| Device | A cairo device (cairo_device_t): the backend-specific object behind a surface, such as a GL context or an output stream. Instances come from bindings that hand one back. |
| FontFace | A cairo font face (cairo_font_face_t): a typeface independent of size and transformation. Font faces come from create or a context, and wrap as the concrete class their type reports (instanceof ToyFontFace after selectFontFace). |
| FontOptions | Cairo font options (cairo_font_options_t): the rendering settings applied to text, such as antialiasing, hinting and font variations. |
| FtFontFace | A FreeType font face returned by Cairo or another native library. |
| Glyph | A cairo_glyph_t: one glyph index and where to draw it. |
| ImageSurface | A surface backed by an in-memory pixel buffer, the usual target for offscreen drawing. |
| LinearPattern | A linear gradient pattern, created with new LinearPattern(...) or Pattern.createLinear. |
| Matrix | An affine transformation (cairo_matrix_t) mapping user space to device space: x' = xx * x + xy * y + x0 and y' = yx * x + yy * y + y0. |
| MeshPattern | A mesh gradient pattern, created with new MeshPattern() or Pattern.createMesh: a set of Coons patches, each described between beginPatch and endPatch by a path of up to four sides and the colors of its corners. |
| Path | A cairo path (cairo_path_t). Context.copyPath() and Context.copyPathFlat() return one, and Context.appendPath and bindings that take one, such as Gsk.PathBuilder.addCairoPath, accept it as is. |
| Pattern | A cairo pattern (cairo_pattern_t): the source a context paints with, such as a solid color, a gradient, a mesh or another surface. Patterns come from the create* statics or from a context, and wrap as the concrete class their type reports (instanceof LinearPattern for a linear gradient). |
| RadialPattern | A radial gradient pattern, created with new RadialPattern(...) or Pattern.createRadial. |
| RecordingSurface | A surface that records the drawing operations applied to it, for replaying them onto other surfaces. |
| Rectangle | A rectangle with double-precision edges, as copyClipRectangleList and recording surfaces report. |
| RectangleInt | A rectangle with integer edges, as Cairo regions use. |
| Region | A cairo region (cairo_region_t): a set of integer rectangles, as GTK uses for clip and damage areas. Set operations modify the region in place. |
| ScaledFont | A cairo scaled font (cairo_scaled_font_t): a font face frozen at a given font matrix, transformation and set of font options, ready to measure text and positioned glyphs. |
| Surface | A cairo surface (cairo_surface_t): the target a context draws onto. Surfaces come from the create* statics, from ImageSurface and RecordingSurface, or from GTK, and wrap as the concrete class their backend reports (instanceof ImageSurface for an image surface). |
| TextCluster | A cairo_text_cluster_t: how many bytes of text map to how many glyphs. |
| ToyFontFace | A toy font face, created with new ToyFontFace(...), FontFace.create or a context's selectFontFace. |
Type Aliases
| Type Alias | Description |
|---|---|
| CairoGlyph | One glyph to draw: its index in the font and its position in user space. |
| CairoTextCluster | One text cluster: how many bytes of text map to how many glyphs. |
| ClosePathSegment | A path segment closing the current sub-path. |
| ColorStop | A color stop of a gradient pattern: its offset along the gradient and its color. |
| CurveToSegment | A path segment drawing a cubic Bézier curve through two control points to an end point. |
| DashPattern | A dash pattern as a context reports it: alternating on and off lengths and the offset into them. |
| DeviceOffset | The offset a surface adds to device coordinates. |
| DeviceScale | The scale a surface applies between user and device units. |
| Distance | A displacement in user or device space, unaffected by translation. |
| Extents | A bounding box given by its two opposite corners in user space. |
| FallbackResolution | The resolution a surface falls back to when it rasterizes vector content. |
| FontExtents | Metrics of a font in user space. |
| GlyphConstructorProps | Initial field values for a Glyph; a field left out or set to null keeps zero. |
| InkExtents | The area a recording surface has been drawn on, in its coordinate space. |
| LinearPoints | The two end points of a linear gradient in pattern space. |
| LineToSegment | A path segment drawing a straight line to a point. |
| MoveToSegment | A path segment starting a new sub-path at a point. |
| PathData | One segment of a path copied out of a context or a mesh pattern. |
| Point | A position in user or device space. |
| RadialCircles | The two circles of a radial gradient in pattern space. |
| RectangleConstructorProps | Initial field values for a Rectangle; a field left out or set to null keeps zero. |
| RectangleData | A rectangle as plain data, for the calls that take or return many at once. |
| RectangleIntConstructorProps | Initial field values for a RectangleInt; a field left out or set to null keeps zero. |
| RgbaColor | A color with straight (non-premultiplied) components in the 0 to 1 range. |
| TextClusterConstructorProps | Initial field values for a TextCluster; a field left out or set to null keeps zero. |
| TextExtents | Extents of a run of text or glyphs in user space. |
Functions
| Function | Description |
|---|---|
| statusToString | Returns a human-readable description of a status code. |
| version | Returns the version of the cairo library in use, encoded as major * 10000 + minor * 100 + micro. |
| versionString | Returns the version of the cairo library in use as a string such as "1.18.2". |