drawing-with-pycairo

Solid

Draws images, PDF/SVG vector files and animation frames with pycairo, and supplies what cairo lacks: shaped text for Arabic, Indic and other scripts, text along curves, blur/glow/drop shadows, path booleans, stroke-to-outline, and Gouraud-shaded 3D. Use when writing pycairo or cairo drawing code, generative art, custom diagrams or posters rendered in Python, or when cairo output needs non-Latin text, soft effects, merged shapes or shaded surfaces.

AI & Automation 150 stars 6 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 85/100

Stars 20%
73
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Drawing with pycairo Cairo paints paths with solid colours, gradients, mesh gradients and images, and composites them with 20-odd operators. It writes PNG, PDF, SVG and PostScript. It does **not** shape text, filter pixels, combine paths, outline strokes, or do depth. `scripts/cairokit.py` fills each gap; `scripts/selftest.py` exercises all of it. Both were verified on pycairo 1.29.1 / cairo 1.18.0 / Python 3.11. ## Setup ```bash pip install --break-system-packages pycairo numpy uharfbuzz fonttools skia-pathops python3 /mnt/skills/user/drawing-with-pycairo/scripts/selftest.py /tmp/cairo-selftest ``` The self-test prints the cairo version, whether Pango is usable, per-panel timings, and the path of a 2×2 contact sheet. `Read` that sheet: panel A shows joined Arabic in green next to broken toy-API Arabic in red, B shows four boolean results and an outlined wave, C shows glow and a soft shadow, D shows a smooth-shaded torus. Then: ```python import sys; sys.path.insert(0, "/mnt/skills/user/drawing-with-pycairo/scripts") from cairokit import * ``` In the environment where this was built, pycairo was not preinstalled. Pango was also absent: the system PyGObject was compiled for Python 3.12 while `python3` was 3.11, and there were no Pango typelibs. `pango()` reports which case you are in. ## Render, then look Every render ends with a `Read` of the PNG before the next edit or before reporting. Exit codes and timings don't show visual bugs. In the session that produced this...

Details

Author
oaustegard
Repository
oaustegard/claude-skills
Created
11 months ago
Last Updated
yesterday
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category