drawbot-skia


Namedrawbot-skia JSON
Version 0.5.1 PyPI version JSON
download
home_pagehttp://github.com/justvanrossum/drawbot-skia
SummaryDrawbot implements a simple drawing API to generate 2D vector graphics
upload_time2024-07-21 08:15:29
maintainerNone
docs_urlNone
authorJust van Rossum
requires_python>=3.6
licenseApache License 2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Run tests](https://github.com/justvanrossum/drawbot-skia/workflows/Run%20tests/badge.svg)](https://github.com/justvanrossum/drawbot-skia/actions)

# drawbot-skia

A Python package implementing a subset of the [DrawBot](https://www.drawbot.com) API using [Skia](https://skia.org/) as a backend.

Work in progress!

## Roadmap

1. Get basic shapes working ✅
1. Get basic colors working ✅
1. Get minimal `BezierPath` object working ✅
1. Get transformations working ✅
1. Get single-line, single style `text()` working ✅
1. Get Variable Fonts working ✅
1. Get HarfBuzz shaping working ✅
1. Get OpenType features working ✅
1. Get PNG, JPEG image export working ✅
1. Get PDF export working ✅
1. Get MP4 export working ✅
1. Get SVG export working ✅
1. Get Animated GIF export working
1. Get multi-line, single style `text()` working
1. Get `FormattedString` working
1. Get multi-style `text()` working
1. Get remaining `BezierPath` methods working
1. Get many-things-I-forgot-to-mention working
1. ...
1. `textBox()` 🔴 _(Major Obstacle)_
1. Fill further gaps in DrawBot API

The currently supported subset of Drawbot is [tracked here](https://github.com/justvanrossum/drawbot-skia/issues/5).

## Vision

This project is purely a Python package that implements (part of) the DrawBot drawing API. Using Skia ([skia-python](https://github.com/kyamagu/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.



            

Raw data

            {
    "_id": null,
    "home_page": "http://github.com/justvanrossum/drawbot-skia",
    "name": "drawbot-skia",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Just van Rossum",
    "author_email": "justvanrossum@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/67/f7/06bc08836b8ef75986e138d0eccf9ca724b34f52b1e693188969008fc100/drawbot-skia-0.5.1.tar.gz",
    "platform": null,
    "description": "[![Run tests](https://github.com/justvanrossum/drawbot-skia/workflows/Run%20tests/badge.svg)](https://github.com/justvanrossum/drawbot-skia/actions)\n\n# drawbot-skia\n\nA Python package implementing a subset of the [DrawBot](https://www.drawbot.com) API using [Skia](https://skia.org/) as a backend.\n\nWork in progress!\n\n## Roadmap\n\n1. Get basic shapes working \u2705\n1. Get basic colors working \u2705\n1. Get minimal `BezierPath` object working \u2705\n1. Get transformations working \u2705\n1. Get single-line, single style `text()` working \u2705\n1. Get Variable Fonts working \u2705\n1. Get HarfBuzz shaping working \u2705\n1. Get OpenType features working \u2705\n1. Get PNG, JPEG image export working \u2705\n1. Get PDF export working \u2705\n1. Get MP4 export working \u2705\n1. Get SVG export working \u2705\n1. Get Animated GIF export working\n1. Get multi-line, single style `text()` working\n1. Get `FormattedString` working\n1. Get multi-style `text()` working\n1. Get remaining `BezierPath` methods working\n1. Get many-things-I-forgot-to-mention working\n1. ...\n1. `textBox()` \ud83d\udd34 _(Major Obstacle)_\n1. Fill further gaps in DrawBot API\n\nThe currently supported subset of Drawbot is [tracked here](https://github.com/justvanrossum/drawbot-skia/issues/5).\n\n## Vision\n\nThis project is purely a Python package that implements (part of) the DrawBot drawing API. Using Skia ([skia-python](https://github.com/kyamagu/skia-python)) ensures this can be done in a cross-platform way.\n\nA 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!\n\n## Compatibility caveats\n\nSome parts of the DrawBot API will be hard or impractical to duplicate.\n\nSkia 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.\n\nGenerally, 100% text compatibility with DrawBot should not be top priority, as matching CoreText behavior will be a huge challenge.\n\nThe `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.\n\n## Strategy\n\nSo 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\u2019s 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.\n\nPotentially, some higher level code could be shared (for example, drawing code that uses lower level primitives), but that will have to been seen later.\n\n## Install\n\nThe quickest way to install the latest release is with pip:\n\n`pip install drawbot-skia`\n\n_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._\n\nIf you want to see the source code and possibly contribute: clone the repo, and do `pip install -e .` in the root directory.\n\n## Usage\n\nTo adapt a DrawBot script to `drawbot-skia` you can do a couple of things:\n\n- Add `from drawbot_skia.drawbot import *` at the top of your script\n- Or `import drawbot_skia.drawbot as db` if that's your preferred style\n\nOr you can use the `drawbot` runner tool from the command line:\n\n- `drawbot mydrawbotscript.py output.png`\n\nWith 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.\n\n\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "Drawbot implements a simple drawing API to generate 2D vector graphics",
    "version": "0.5.1",
    "project_urls": {
        "Homepage": "http://github.com/justvanrossum/drawbot-skia"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "44d69361504157ff6bc35a7b2397800706abb1cda058131eb46920c70755dc73",
                "md5": "69e762db429cb354dfee0440400ec590",
                "sha256": "7418e037349fb56029e14525f3e30a8e3c636218e4453a1382cc3432e1c2bed9"
            },
            "downloads": -1,
            "filename": "drawbot_skia-0.5.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "69e762db429cb354dfee0440400ec590",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 28172,
            "upload_time": "2024-07-21T08:15:28",
            "upload_time_iso_8601": "2024-07-21T08:15:28.546834Z",
            "url": "https://files.pythonhosted.org/packages/44/d6/9361504157ff6bc35a7b2397800706abb1cda058131eb46920c70755dc73/drawbot_skia-0.5.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "67f706bc08836b8ef75986e138d0eccf9ca724b34f52b1e693188969008fc100",
                "md5": "1e7b5a586669daa6d6c4ef29d9ce00dd",
                "sha256": "5a59739466af144552af68dc41bbf2cd66bc216042edb434e7ec738d00f92403"
            },
            "downloads": -1,
            "filename": "drawbot-skia-0.5.1.tar.gz",
            "has_sig": false,
            "md5_digest": "1e7b5a586669daa6d6c4ef29d9ce00dd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 2344131,
            "upload_time": "2024-07-21T08:15:29",
            "upload_time_iso_8601": "2024-07-21T08:15:29.961777Z",
            "url": "https://files.pythonhosted.org/packages/67/f7/06bc08836b8ef75986e138d0eccf9ca724b34f52b1e693188969008fc100/drawbot-skia-0.5.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-21 08:15:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "justvanrossum",
    "github_project": "drawbot-skia",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "drawbot-skia"
}
        
Elapsed time: 0.35377s