Skip to content

Conversation

@wmedrano
Copy link
Contributor

@wmedrano wmedrano commented Dec 15, 2025

Support is added by:

  • Utilizing Skrifa's ColorGlyph.

  • Creating a pen that can capture ColorGlyph instructions

  • Converting the instructions into tiny_skia calls

  • Seems to match fonts.google.com for colors+linear_gradients

    • Chrome image
    • Sleipnir
colored_font

Follow up

  • Convert to SVG and use Re-SVG to reduce code complexity
  • Improve output height and centering algorithm.
  • Support layers

@wmedrano wmedrano marked this pull request as ready for review December 15, 2025 21:16
@wmedrano wmedrano force-pushed the wmedrano branch 5 times, most recently from 18cd76e to 5b3b575 Compare December 19, 2025 18:48
@wmedrano wmedrano marked this pull request as draft December 19, 2025 20:45
@wmedrano
Copy link
Contributor Author

wmedrano commented Dec 19, 2025

Currently trying a different approach. Should be ready in a business day or 2

Some items are incomplete:
- Bounding boxes could use some work. This uses the same algorithm
  that was already in place.
- Text is parsed line-by-line. We should probably use harfbuzz to
  handle all positioning.
- For colr fonts, we use `DrawSettings` with `Size::unscaled` and
  handle the scaling manually. We should use the built-in scaling.
@wmedrano wmedrano force-pushed the wmedrano branch 11 times, most recently from ce505dc to d9e19da Compare December 23, 2025 18:48
@wmedrano wmedrano marked this pull request as ready for review December 23, 2025 19:13
Copy link
Member

@dfrg dfrg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few nits but generally LGTM for initial color support. I'm curious to see how this evolves to support layers/blending.

- Apply transformation to gradients, not just their points
- Rename ColorPainter -> GlyphPainter
@wmedrano wmedrano merged commit c388064 into main Dec 24, 2025
6 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