drawbot
drawbot copied to clipboard
Linux compatibility?
I am sorry if this sounds like trolling, but I am confused how such a cool, hacker-friendly, open source program is available only for MacOS platform. I'd love to use it to inspire my kids to code. But we have zero Apple products in our household, mostly Linux (Ubuntu), and Windows on dual boot or VM for those rare occasions when one really needs some software from that world. I know the next thing I'd be asked is, why don't I make a fork that works on Ubuntu. Well, I'm afraid I'm not entirely competent to contribute to such development, but I could definitely try to participate if there would be some kind of road map, provided by somebody who knows enough specifics about the difficulties involved in such venture.
I'd love to have such a non-Mac version, too! But this is how open source works: someone has to do the work, and the core developers of DrawBot (@typemytype and me) don't have the need for such versions, nor the resources or even the knowhow to make it happen.
So: contributions are welcome!
Of course. Thanks, for the reply, Just. I was impressed by your talk, this is how I came here. Apparently, the start for Linux compatibility would be to create an abstraction layer for the OSx-specific APIs AppKit, CoreText and Quartz, so that the functionality provided by these modules could be filled in for the Xlib environment. Indeed, this requires quite deep knowledge of both platforms.
Just so this doesn't get lost: Cairo is pretty awesome and runs on all platforms. I've had some success with relatively simple vector graphics, and I'm curious how well it will work with text, OpenType and variable fonts.
(The bad thing about Cairo that it isn't available from pip.)
The Cairo API does not mention variable fonts at all, so I'd assume there is no support. I managed to find only one commit in the libraries git repository that mentions variable fonts. As for general font support, Inkscape uses Pango + Cairo for text rendering, and there is currently going on some development to support variable fonts on Inkscape. Perhaps it will trigger some change in Cairo API, but maybe it doesn't concern Cairo at all, as all the serious font business should be handled via Pango, like in this example.
Awesome, thanks for that example link: I'm glad to see how easily pango and cairo can work together from Python.
It will be necessarily start with a subset of the DrawBot drawing API anyway, so a lack of immediate variable font support should not stop us...
GNU+Linux user here, I want to see this happen and am willing to test early versions and help out with development, I just can't devote the amount of time it would take to do this all by myself right now. Has any progress been made?
I'm thinking a good MVP would be rendering images from the command line with DrawBot installed as a Python3 module, thoughts?
DrawBot is my primary tool for graphic design work and not being able to use it on GNU is a big pain point for me.
If one of the DrawBot contributors can sketch the basic architecture for me, I can try an fill in the details. @Passiday Let me know if you are still interested in working on this?
@eliheuer I am still interested, and occasionally I could devote some time for coding and testing. But right now I have no clue where to start. Heck, I don't even own an Apple computer where I could see the DrawBot app running :)
I started working on this a bit here: https://github.com/eliheuer/cairo-drawbot
The above reuses lots of code from https://github.com/Zulko/gizeh, but my goal is cross-platform compatibility with DrawBot, so contributing to the Gizeh project directly doesn't make sense for me.
Why not use http://xxyxyz.org/even and extend http://xxyxyz.org/flat to cover the total DrawBot API?
I think that using cairo as the multiplatform graphics backend would be much better than using a pure-python implementation like flat. Just my 2c...
As I just said in mfeq/mfeq#1, why not Skia? Usable from Python and supports drawing text with HarfBuzz. HarfBuzz I think already supports variable fonts in its beta branch and that will probably soon be in their master/one of their releases
Oh, I hadn't seen Skia now has Python bindings. That's very cool in many ways, thanks!
I know this is something @eliheuer has wanted for a while and that's how I'd recommend going about it. The Skia API has been an absolute joy to work with through Rust in Qglif (part of my new FOSS font editor). I think he even has the skills to contribute it to Drawbot himself.
Ok, here's a first stab: https://github.com/justvanrossum/drawbot-skia
It's far from complete, but there's enough to have some fun.
Biggest missing features that should have priority:
- harfbuzz-based text shaping (will borrow some code from FontGoggles)
- multistyled text
- mp4/animated gif export
- textBox() (that's a biggie, with line wrapping and hyphenation and all)
Apart from that there are many smaller gaps in DrawBot api support.
Also bigger gaps that have very low priority for me: ImageObject.
Variable font support is mostly there, except that it doesn't work properly on Linux, possibly due to a bug in skia-python. Some help with figuring that out would be appreciated: justvanrossum/drawbot-skia/issues/1
Libraqm might help