Thin wrapper for the cairo 2D graphics library.
🚧 Very much a work in progress... 🚧
As suggested in the cairo Appendix, the type names and method names of the original C library were changed to follow the Zig Style Guide. For example, a method like cairo_set_source(cr, source) in cairo becomes cr.setSource(source) in zig-cairo.
Run zig build --help to see all the compilation targets.
Most examples generate a PNG. Here I use feh to view the generated file:
zig build rounded_rectangle && feh examples/generated/rounded_rectangle.png
zig build spirograph && feh examples/generated/spirograph.png
zig build text_extents && feh examples/generated/text_extents.pngA few examples generate a SVG:
zig build surface_svg && inkscape examples/generated/test-image.svgSome other examples don't generate any image file. This one opens a window and renders cairo graphics inside of it (using a cairo XCB surface):
zig build surface_xcb# run all tests, in all modes (debug, release-fast, release-safe, release-small)
zig build test
# run all tests, only in debug mode
zig build test-debugTested against these zig compiler versions on Travis CI and using zigup on my machine: