Commita0086942Recorded29 Mar 2026Repositorysigil-cairo

Add README

Changed
 README.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)
Diff
README.mdadded
@@ -0,0 +1,54 @@
+1
# sigil-cairo
+2
+3
Cairo 2D graphics FFI bindings for [Sigil](https://codeberg.org/sigil/sigil).
+4
+5
## Features
+6
+7
- Image surface creation and management
+8
- Drawing context lifecycle (create, save, restore, destroy)
+9
- Path operations (rectangle, arc, curve-to, line-to)
+10
- Fill and stroke rendering
+11
- Source color (RGB/RGBA) and pattern support
+12
- Linear and radial gradients
+13
- Text rendering and extents
+14
- Transforms (translate, scale, rotate)
+15
- PNG output
+16
- Compositing operators
+17
- Matrix operations
+18
- Dash patterns
+19
- Convenience macros (`with-cairo-context`)
+20
+21
## Usage
+22
+23
```scheme
+24
(import (sigil ffi)
+25
(cairo))
+26
+27
(let ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 200 200)))
+28
(with-cairo-context surface
+29
(lambda (cr)
+30
(cairo-set-source-rgb cr 0.2 0.3 0.8)
+31
(cairo-rectangle cr 10.0 10.0 180.0 180.0)
+32
(cairo-fill cr)))
+33
(cairo-surface-write-to-png surface "output.png")
+34
(cairo-surface-destroy surface))
+35
```
+36
+37
## Dependencies
+38
+39
- sigil-stdlib
+40
- sigil-ffi
+41
+42
Requires Cairo system library (`libcairo`).
+43
+44
## Development
+45
+46
```bash
+47
guix shell -m ~/Projects/Code/sigil/sigil/manifest.scm
+48
sigil build --redirects dev-redirects.sgl
+49
sigil test --redirects dev-redirects.sgl
+50
```
+51
+52
## License
+53
+54
BSD-3-Clause