Skip to content

feat(text): colour emoji render in their own colours, not the words' - #284

Merged
jub0t merged 1 commit into
jub0t:mainfrom
minecart551-prog:main
Oct 9, 2026
Merged

jub0t merged 1 commit into
jub0t:mainfrom
minecart551-prog:main

Conversation

@minecart551-prog

Copy link
Copy Markdown
Contributor

A title painted every glyph as an outline filled with the words' colour, which a colour emoji face has none of: draws() skipped any face whose glyphs were not outlines, so Noto Color Emoji was never even borrowed and the emoji fell to a monochrome fallback face - the white text of #276 - or to a .notdef box where nothing else had it.

A glyph that colours itself now stays out of the line's path and is laid over the words once they are painted: a bitmap strike (CBDT/CBLC, sbix) decoded to its box, or a COLR v0 face's layers outlined in their palette colours. Plain pictures, as asked - no shadow and no stroke on either. A colour face is also borrowed before a monochrome one whatever weight the title asked for, so DejaVu and Symbola only get an emoji when no colour face has it.

Faces that could only draw with constructs this crate does not follow - COLR v1 gradients, clips, transforms, SVG documents - are not counted as able to draw, and a glyph whose paint turns out unsupported falls back to its outline as before: nothing that used to paint now paints nothing.

The layered case is tested on a COLR face cut from the bundled one inside the test, so it runs on a machine with no fonts installed at all; the bitmap case borrows the machine's colour emoji face and skips when it has none.

Fixes #276

A title painted every glyph as an outline filled with the words' colour,
which a colour emoji face has none of: draws() skipped any face whose
glyphs were not outlines, so Noto Color Emoji was never even borrowed and
the emoji fell to a monochrome fallback face - the white text of jub0t#276 - or
to a .notdef box where nothing else had it.

A glyph that colours itself now stays out of the line's path and is laid
over the words once they are painted: a bitmap strike (CBDT/CBLC, sbix)
decoded to its box, or a COLR v0 face's layers outlined in their palette
colours. Plain pictures, as asked - no shadow and no stroke on either. A
colour face is also borrowed before a monochrome one whatever weight the
title asked for, so DejaVu and Symbola only get an emoji when no colour
face has it.

Faces that could only draw with constructs this crate does not follow -
COLR v1 gradients, clips, transforms, SVG documents - are not counted as
able to draw, and a glyph whose paint turns out unsupported falls back to
its outline as before: nothing that used to paint now paints nothing.

The layered case is tested on a COLR face cut from the bundled one inside
the test, so it runs on a machine with no fonts installed at all; the
bitmap case borrows the machine's colour emoji face and skips when it has
none.

Fixes jub0t#276

Signed-off-by: minecart551-prog <minecart551@gmail.com>
@jub0t
jub0t merged commit 8a00307 into jub0t:main Oct 9, 2026
1 check 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.

Feature Request: Emoji Support

2 participants