Skip to main content

Run tests

drawbot-skia

A Python package implementing a subset of the DrawBot API using Skia as a backend.

Work in progress!

Roadmap

  1. Get basic shapes working ✅
  2. Get basic colors working ✅
  3. Get minimal BezierPath object working ✅
  4. Get transformations working ✅
  5. Get single-line, single style text() working ✅
  6. Get Variable Fonts working ✅
  7. Get HarfBuzz shaping working ✅
  8. Get OpenType features working ✅
  9. Get PNG, JPEG image export working ✅
  10. Get PDF export working ✅
  11. Get MP4 export working ✅
  12. Get SVG export working ✅
  13. Get Animated GIF export working
  14. Get multi-line, single style text() working
  15. Get FormattedString working
  16. Get multi-style text() working
  17. Get remaining BezierPath methods working
  18. Get many-things-I-forgot-to-mention working
  19. ...
  20. textBox() 🔴 (Major Obstacle)
  21. Fill further gaps in DrawBot API

The currently supported subset of Drawbot is tracked here.

Vision

This project is purely a Python package that implements (part of) the DrawBot drawing API. Using Skia (skia-python) ensures this can be done in a cross-platform way.

A DrawBot-like cross-platform application shell can be developed, but that would be a separate project. Looking forward to the drawbot-qt, drawbot-wx, drawbot-win or any drawbot-* projects of the future!

Compatibility caveats

Some parts of the DrawBot API will be hard or impractical to duplicate.

Skia has only low level support for text, so we'll have to do Unicode processing, line wrapping, hyphenation, and shaping ourselves. In other words, textBox() will be a tough one to crack.

Generally, 100% text compatibility with DrawBot should not be top priority, as matching CoreText behavior will be a huge challenge.

The ImageObject relies heavily on builtin macOS functionality, and it is huge. At best, we should support a small subset of it, but even that is low priority.

Strategy

So far no existing DrawBot code has been reused. Perhaps that small snippets will be copied, perhaps a part of the test suite will be adapted. Other than that I want this to be an independent project, and would like to use Skia’s powers to maximum effect, keeping efficiency and performance in mind. DrawBot's ties to macOS are so strong that it makes platform-neutral code reuse virtually impossible.

Potentially, some higher level code could be shared (for example, drawing code that uses lower level primitives), but that will have to been seen later.

Install

The quickest way to install the latest release is with pip:

pip install drawbot-skia

Note for Windows: skia-python is only supported for the 64-bit version of Python, so that goes for drawbot-skia as well, so make sure you use one of the x86-64 Python installers.

If you want to see the source code and possibly contribute: clone the repo, and do pip install -e . in the root directory.

Usage

To adapt a DrawBot script to drawbot-skia you can do a couple of things:

  • Add from drawbot_skia.drawbot import * at the top of your script
  • Or import drawbot_skia.drawbot as db if that's your preferred style

Or you can use the drawbot runner tool from the command line:

  • drawbot mydrawbotscript.py output.png

With the drawbot runner tool, you won't need any Drawbot import in the script, nor do you need a saveImage(...) to export results. It pretty much behaves as if you hit "Run" in the classic Drawbot application.

Metadata

Release files for drawbot-skia 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for drawbot-skia 0.5.1
File Size Uploaded
drawbot-skia-0.5.1.tar.gz 2.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for drawbot-skia 0.5.1
File Interpreter ABI Platform
drawbot_skia-0.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 2.4 MB

Release files / drawbot-skia-0.5.1.tar.gz

Download URL drawbot-skia-0.5.1.tar.gz
Size 2.3 MB
Tags Source
SHA-256 checksum
How to use checksums
5a59739466af144552af68dc41bbf2cd66bc216042edb434e7ec738d00f92403
BLAKE2b-256 checksum
How to use checksums
67f706bc08836b8ef75986e138d0eccf9ca724b34f52b1e693188969008fc100
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release files / drawbot_skia-0.5.1-py3-none-any.whl

Download URL drawbot_skia-0.5.1-py3-none-any.whl
Size 28.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7418e037349fb56029e14525f3e30a8e3c636218e4453a1382cc3432e1c2bed9
BLAKE2b-256 checksum
How to use checksums
44d69361504157ff6bc35a7b2397800706abb1cda058131eb46920c70755dc73
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files

0.5.0

2 release files

0.4.8

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page