Expand description
§Cairo bindings
Rust bindings for Rust and wrappers for Cairo, part of gtk-rs-core.

Cairo 1.14 is the lowest supported version for the underlying library.
§Minimum supported Rust version
Currently, the minimum supported Rust version is 1.83.0.
§Default-on features
- use_glib - Use with glib
§Fileformat features
- png - Reading and writing PNG images
- pdf - Rendering PDF documents
- svg - Rendering SVG documents
- ps - Rendering PostScript documents
§Cairo API version features
- v1_16 - Use Cairo 1.16 APIs
§Documentation
§X Window features
- xcb - X Window System rendering using the XCB library
- xlib - X Window System rendering using XLib
§Windows API features
- win32-surface - Microsoft Windows surface support
§Using
We recommend using crates from crates.io, as demonstrated here.
If you want to track the bleeding edge, use the git dependency instead:
[dependencies]
cairo-rs = { git = "https://github.com/gtk-rs/gtk-rs-core.git", package = "cairo-rs" }Avoid mixing versioned and git crates like this:
# This will not compile
[dependencies]
cairo-rs = "0.13"
cairo-rs = { git = "https://github.com/gtk-rs/gtk-rs-core.git", package = "cairo-rs" }§See Also
§License
cairo is available under the MIT License, please refer to it.
Re-exports§
Structs§
- Context
- Device
- Font
Extents - Font
Face - GLib type: Shared boxed type with reference counted clone semantics.
- Font
Options - GLib type: Boxed type with copy-on-clone semantics.
- Glyph
- Gradient
- Image
Surface - Image
Surface Data - Image
Surface Data Owned - Linear
Gradient - Mapped
Image Surface - Matrix
- Mesh
- Path
- Path
Segments - Pattern
- PdfOutline
- PdfSurface
pdf - PsSurface
ps - Radial
Gradient - Recording
Surface - Rectangle
- Rectangle
Int - Rectangle
List - Region
- Scaled
Font - GLib type: Shared boxed type with reference counted clone semantics.
- Solid
Pattern - Stream
With Error pdforsvgorps - Surface
- Surface
Pattern - SvgSurface
svg - Text
Cluster - Text
Extents - User
Data Key - User
Font Face - Version
- XCBConnection
xcb - XCBDrawable
xcb - XCBPixmap
xcb - XCBRender
Pict Form Info xcb - XCBScreen
xcb - XCBSurface
xcb - XCBVisual
Type xcb
Enums§
- Antialias
- Borrow
Error - Content
- Device
Type - Error
- Extend
- Fill
Rule - Filter
- Font
Slant - Font
Type - Font
Weight - Format
- FtSynthesize
freetype - Hint
Metrics - Hint
Style - IoError
- LineCap
- Line
Join - Mesh
Corner - Operator
- Path
Data Type - Path
Segment - Pattern
Type - PdfMetadata
pdf - PdfVersion
pdf - PsLevel
ps - Region
Overlap - Script
Mode script - Subpixel
Order - Surface
Type - SvgUnit
svgandv1_16 - SvgVersion
svg - Text
Cluster Flags
Constants§
- CAIRO_
TAG_ DEST v1_16 - CAIRO_
TAG_ LINK v1_16 - MIME_
TYPE_ CCITT_ FAX v1_16 - MIME_
TYPE_ CCITT_ FAX_ PARAMS v1_16 - MIME_
TYPE_ EPS v1_16 - MIME_
TYPE_ EPS_ PARAMS v1_16 - MIME_
TYPE_ JBIG2 - MIME_
TYPE_ JBIG2_ GLOBAL - MIME_
TYPE_ JBIG2_ GLOBAL_ ID - MIME_
TYPE_ JP2 - MIME_
TYPE_ JPEG - MIME_
TYPE_ PNG - MIME_
TYPE_ UNIQUE_ ID - MIME_
TYPE_ URI - PDF_
OUTLINE_ ROOT v1_16
Functions§
- debug_
reset_ ⚠static_ data - Resets all static data within cairo to its original state (i.e. identical to the state at program invocation). For example, all caches within cairo will be flushed empty.
- version_
string