Skip to main content

A Python-based renderer for OpenType COLRv1 fonts, with multiple backends.

Project description

Python package

BlackRenderer

Developing a Python-based renderer for OpenType COLRv1 fonts, with multiple backends.

Big Smiley Face Icon

Goals

  • Use fonttools to parse COLRv1 data
  • Adapter classes for various 2D rendering back-ends:
    1. Debugging/printing (text dump of scene graph / 2D API calls)
    2. skia-python
    3. pycairo
    4. SVG
    5. CoreGraphics (macOS)
    6. ...
  • 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


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.0.tar.gz (7.7 MB view hashes)

Uploaded Source

Built Distribution

blackrenderer-0.1.0-py3-none-any.whl (25.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page