A Python-based renderer for OpenType COLRv1 fonts, with multiple backends.
Project description
BlackRenderer
Developing a Python-based renderer for OpenType COLRv1 fonts, with multiple backends.
Goals
- Use fonttools to parse COLRv1 data
- Adapter classes for various 2D rendering back-ends:
- Debugging/printing (text dump of scene graph / 2D API calls)
- skia-python
- pycairo
- SVG
- CoreGraphics (macOS)
- ...
- hb-view-like command line app with switchable backend
Usage
BlackRenderer comes with an hb-view-like command line tool, that can be used like this:
$ blackrenderer font.ttf ABC🤩 output.png --font-size=100
Install
If you have a Python 3 environment set up, then all you need to do is:
$ pip install blackrenderer
Install for contributing / setting up an environment
Have Python 3.7 or higher installed.
Open Terminal.
"cd" into the project repo directory.
Create a virtual environment:
$ python3 -m venv venv --prompt=black-renderer
Activate the venv:
$ source venv/bin/activate
(You need to activate the virtual environment for every new terminal session.)
Upgrade pip:
$ pip install --upgrade pip
Install the requirements:
$ pip install -r requirements.txt
$ pip install -r requirements-dev.txt
Install blackrenderer in editable mode:
$ pip install -e .
Run the tests:
$ pytest
Maintainers: how to release
To cut a release, make an annotated git tag, where the tag is in this format: v1.2.3, where 1, 2 and 3 represent major, minor and micro version numbers. You can add "aN" or "bN" or "rc" to mark alpha, beta or "release candidate" versions. Examples: v1.2.3, v1.2.3b2, v1.2.3a4, v1.2.3rc.
The message for the annotated tag should contain the release notes.
Then use "git push --follow-tags" to trigger the release bot. Example session:
$ git tag -a v1.2.3 -m "v1.2.3 -- fixed issue #12345"
$ git push --follow-tags
This process will create a GitHub release, as well as upload the package to PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for blackrenderer-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc63a9b1b0b9fa872d506a0a4f9f7680ef04cd81624eded1124c19c389925184 |
|
MD5 | aacb929edf791e3e7aedcce050dfa2a8 |
|
BLAKE2b-256 | 02d7cb3c5fe8c2972a8fc80c59d0501f032b7bb5597146156b970f1794f25a0b |