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 / 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
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
blackrenderer-0.1.0a1.tar.gz
(7.7 MB
view hashes)
Built Distribution
Close
Hashes for blackrenderer-0.1.0a1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03244fd8064ba33b4c3f461ebcdbaa1a8095ef2504557e15f4d7f3db8266fb31 |
|
MD5 | fdf796f5abf782f88da52f4582966519 |
|
BLAKE2b-256 | 63f49d2f24b1dd19889f5c4ce9914c18792af048eea94d26055b60c3d0982ebf |