PicTex is a Python library for generating images via CSS Flexbox layout. It uses a declarative API to compose elements, supports text shaping via HarfBuzz, Unicode bidirectional text, gradients, and inline spans. Current version 2.3.0 requires Python >=3.9. Releases occur irregularly, with breaking changes in v2.0.0 that renamed many methods.
pip install pictexNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a 200x100 canvas with a blue rectangle and text, renders to PNG.
Follow the migration guide at https://github.com/francozanardi/pictex/blob/main/docs/MIGRATION.md
Use standard font paths; HarfBuzz handles shaping automatically.
Always specify a width on text-containing elements, e.g., Text("...", width=200).Explicitly set properties on each Span to avoid inheritance surprises.
Upgrade to latest: pip install --upgrade pictex
Install: pip install pictex
Use canvas.add() or the new positioning methods. See migration guide.
No dependency data recorded yet.