59 releases

Uses new Rust 2024

0.22.0-alpha.2 Jan 10, 2026
0.21.5 Dec 2, 2025
0.21.2 Sep 17, 2025
0.21.0 Jul 15, 2025
0.0.4 Jul 18, 2015

#29 in Images

Download history 166650/week @ 2025-09-29 180841/week @ 2025-10-06 167069/week @ 2025-10-13 170046/week @ 2025-10-20 162979/week @ 2025-10-27 153120/week @ 2025-11-03 152495/week @ 2025-11-10 158202/week @ 2025-11-17 156011/week @ 2025-11-24 174099/week @ 2025-12-01 172337/week @ 2025-12-08 174187/week @ 2025-12-15 158314/week @ 2025-12-22 156211/week @ 2025-12-29 196885/week @ 2026-01-05 203636/week @ 2026-01-12

735,420 downloads per month
Used in 1,115 crates (126 directly)

MIT license

1MB
20K SLoC

Cairo bindings

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

screenshot

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.

Dependencies

~0.1–4MB
~82K SLoC