Package: drawbot-skia
drawbot-skiaA Python package implementing a subset of theDrawBotAPI usingSkiaas a backend.Work in progress!RoadmapGet basic shapes working ✅Get basic colors working ✅Get minimalBezierPathobject working ✅Get transformations working ✅Get single-line, single styletext()working ✅Get Variable Fonts working ✅Get HarfBuzz shaping working ✅Get OpenType features working ✅Get PNG, JPEG image export working ✅Get PDF export working ✅Get MP4 export working ✅Get SVG export working ✅Get Animated GIF export workingGet multi-line, single styletext()workingGetFormattedStringworkingGet multi-styletext()workingGet remainingBezierPathmethods workingGet many-things-I-forgot-to-mention working...textBox()🔴(Major Obstacle)Fill further gaps in DrawBot APIThe currently supported subset of Drawbot istracked here.VisionThis 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 thedrawbot-qt,drawbot-wx,drawbot-winor anydrawbot-*projects of the future!Compatibility caveatsSome 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.TheImageObjectrelies 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.StrategySo 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.InstallThe quickest way to install the latest release is with pip:pip install drawbot-skiaNote 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 dopip install -e .in the root directory.UsageTo adapt a DrawBot script todrawbot-skiayou can do a couple of things:Addfrom drawbot_skia.drawbot import *at the top of your scriptOrimport drawbot_skia.drawbot as dbif that's your preferred styleOr you can use thedrawbotrunner tool from the command line:drawbot mydrawbotscript.py output.pngWith thedrawbotrunner tool, you won't need any Drawbot import in the script, nor do you need asaveImage(...)to export results. It pretty much behaves as if you hit "Run" in the classic Drawbot application.