Skip to content
/ zig-cairo Public
forked from jackdbd/zig-cairo

wrapper for cairo

License

Unknown, LGPL-2.1 licenses found

Licenses found

Unknown
LICENSE
LGPL-2.1
LICENSE-LGPL-2.1-only
Notifications You must be signed in to change notification settings

vkcz/zig-cairo

 
 

Repository files navigation

zig-cairo

Build Status

Thin wrapper for the cairo 2D graphics library.

🚧 Very much a work in progress... 🚧

Naming convention

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.

Examples

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.png

A few examples generate a SVG:

zig build surface_svg && inkscape examples/generated/test-image.svg

Some 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

Tests

# 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-debug

Tested against these zig compiler versions on Travis CI and using zigup on my machine:

  • 0.7.0 (not working, see #2)
  • 0.7.1 (not working, see #2)
  • 0.8.0-dev.1032+8098b3f84

About

wrapper for cairo

Resources

License

Unknown, LGPL-2.1 licenses found

Licenses found

Unknown
LICENSE
LGPL-2.1
LICENSE-LGPL-2.1-only

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Zig 87.1%
  • Roff 12.4%
  • Shell 0.5%