Version0.7.0Verifiednot yet verifiedLicenseBSD-3-Clause

sigil-cairo

Cairo 2D graphics bindings for Sigil

Report a bug or suggest a feature
Readme

sigil-cairo

Cairo 2D graphics FFI bindings for Sigil.

Features

  • Image surface creation and management
  • Drawing context lifecycle (create, save, restore, destroy)
  • Path operations (rectangle, arc, curve-to, line-to)
  • Fill and stroke rendering
  • Source color (RGB/RGBA) and pattern support
  • Linear and radial gradients
  • Text rendering and extents
  • Transforms (translate, scale, rotate)
  • PNG output
  • Compositing operators
  • Matrix operations
  • Dash patterns
  • Convenience macros (with-cairo-context)

Usage

(import (sigil ffi)
        (cairo))

(let ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 200 200)))
  (with-cairo-context surface
    (lambda (cr)
      (cairo-set-source-rgb cr 0.2 0.3 0.8)
      (cairo-rectangle cr 10.0 10.0 180.0 180.0)
      (cairo-fill cr)))
  (cairo-surface-write-to-png surface "output.png")
  (cairo-surface-destroy surface))

Dependencies

  • sigil-stdlib
  • sigil-ffi

Requires Cairo system library (libcairo).

System Prerequisites

Development

sigil deps install
sigil build
sigil test

License

BSD-3-Clause

Clone

$ git clone https://codeberg.org/sigil/sigil-cairo

Releases

v0.8.0 — latest by version, released 29 Mar 2026

All releases — 2 tags in this repository.

Source

Browse the latest source

One page per file, and every line has a permalink.

Recent commitsAtom

The last 20 commits keep a page here. Everything older lives in the clone.