SVG font support

Open
#6,170 0 comments 5 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
28/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
c, python

Research direction

Start with the FreeType demo callbacks in rsvg-port.c and the related Pillow issue #3509. Use those references to understand the required SVG-font rendering and licensing integration, then verify that Pillow supports loading and rendering SVG fonts.

Written by the indexing model from the issue text.

Description

Font Rendering

FreeType 2.12 (#6169) adds support for color fonts in SVG format.

From https://github.com/freetype/freetype/commit/21d0fa374200aecc6605daf034a47167ea82ed6f:

FreeType now handles OT-SVG fonts, to be controlled with
FT_CONFIG_OPTION_SVG configuration macro. By default, it can
only load the 'SVG ' table of an OpenType font. However, by using
the svg-hooks property of the new 'ot-svg' module it is possible
to register an external SVG rendering engine. The FreeType demo
programs have been set up to use 'librsvg' as the rendering
library.

It would be nice to add support for this to Pillow.
librsvg appears to be LGPL-2.1 licensed, so a wrapper similar to that used for FriBiDi/Raqm may be needed.
This is closely related to loading SVG images in Pillow, it may be possible to add support for both at once: #3509

For reference, the freetype demo callbacks are here: https://gitlab.freedesktop.org/freetype/freetype-demos/-/blob/master/src/rsvg-port.c

Dominant language
Python
Stars
14k
Forks
2.6k
Avg merge
1d 1h
Merged PRs (30d)
205

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from python-pillow/Pillow

All issues in python-pillow/Pillow

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.