Skip to content

Add COLRv1 color font rendering support #27

Merged
simoncozens merged 3 commits intomainfrom
colrv1
Apr 3, 2026
Merged

Add COLRv1 color font rendering support #27
simoncozens merged 3 commits intomainfrom
colrv1

Conversation

@m4rc1e
Copy link
Copy Markdown
Contributor

@m4rc1e m4rc1e commented Apr 2, 2026

Adds a ColorRenderer that renders COLR v0/v1 glyphs via skrifa's ColorPainter trait and tiny-skia as the 2D backend.

Each glyph is rendered once and cached as an RGBA tile; subsequent uses composite the cached tile.

The existing outline renderer is unchanged and used for non-color fonts via an if/else dispatch in diff_many_words.

m4rc1e added 3 commits April 2, 2026 14:38
Adds a ColorRenderer that renders COLR v0/v1 glyphs via skrifa's
ColorPainter trait and tiny-skia as the 2D backend. Each glyph is
rendered once and cached as an RGBA tile; subsequent uses composite
the cached tile. The existing outline renderer is unchanged and used
for non-color fonts via an if/else dispatch in diff_many_words.
Four tests using a subsetted Nabla COLRv1 font:
- render produces a non-empty image
- cached glyph tiles contain actual color (not just grayscale)
- glyph cache is reused across words
- same font compared to itself yields zero pixel diff
@simoncozens simoncozens merged commit f6facd0 into main Apr 3, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants