Skip to content

Color Emojis (COLRv1)#49

Open
ErikBuer wants to merge 15 commits into
JuliaGraphics:masterfrom
ErikBuer:master
Open

Color Emojis (COLRv1)#49
ErikBuer wants to merge 15 commits into
JuliaGraphics:masterfrom
ErikBuer:master

Conversation

@ErikBuer
Copy link
Copy Markdown

@ErikBuer ErikBuer commented Feb 12, 2026

Upgrades FreeType2_jll to 2.13.4, which supports COLRv1.
Add bindings necessary for drawing COLRv1 emojis, and adds a working example.

Julia version of CI is bumped to support test dependency Images.jl which is used in two tests/examples.

The COLRv1 test generates the following using Noto-COLRV1.ttf font, FreeType.jl and Cairo.jl (packages).

  • Noto-COLRV1.ttf font is downloaded during the test.
image image image image

Closes #48

Related FreeType documentation can be found here here.

@ErikBuer ErikBuer changed the title WIP Bump FreeType_jll and add bindings required for COLRv1 WIP Color Emojis (COLRv1) Feb 12, 2026
@ErikBuer ErikBuer marked this pull request as draft February 12, 2026 23:05
@ErikBuer ErikBuer marked this pull request as ready for review February 14, 2026 14:29
@ErikBuer ErikBuer changed the title WIP Color Emojis (COLRv1) Color Emojis (COLRv1) Feb 14, 2026
@jkrumbiegel
Copy link
Copy Markdown

jkrumbiegel commented Feb 15, 2026

Could you add some info about what these emoji capabilities consist of? Is this all that's needed to draw any emoji out there or is this only one type of them?

The tests are not sufficient as they are now, as you're not comparing any outputs with expected ones. It would make sense I think to extract a couple of emoji as color pngs and save them in the test folder. Then you can reference test against them. Otherwise we don't know if the routines just return garbage pixels, skewed images, or something like that. Also, you're converting to grayscale for some reason but you'd want to check that the colors come out right.

I also like it better if no resources have to be downloaded during testing. If you can, use some font tool to make a font with only a couple emoji in it, that should be sufficiently small to not matter for repo size and so it can be committed. Needs to be a font whose license allows that though.

@ErikBuer
Copy link
Copy Markdown
Author

ErikBuer commented Feb 15, 2026

Hi @jkrumbiegel.

Thanks for taking the time to look at the PR :)

This is not all that is necessary to draw all emoji formats, only ones in COLRv1 format. Users should read the FreeType documentation regarding FreeType capabilities with different font formats. The FreeType bindings are not enough to draw the COLRv1 emojis alone. One also need to use a drawing package, like Cairo.

From the FreeType docs:

Note that FreeType does not provide rendering in general of glyphs that use a ‘COLR’ table! While FreeType has very limited rendering support for ‘COLR’ v0 tables (without a possibility to change the color palette) via FT_Render_Glyph, there is no such convenience code for ‘COLR’ v1 tables – while it appears that v1 is simply an ‘improved’ version of v0, this is not the case: it is a completely different color font format, and you need a dedicated graphics library like Skia or Cairo to handle a v1 table's drawing commands.

The test don't compare anything, but they do ensure no call returns an error. The emoji-tests are intended to aid users in implementing their abstraction and use the bindings.
They are thus more examples than tests, but its nice to keep them running as a test to ensure they work with every update of the package. That was the intent anyways..

The responsibility of the tests in this package is just to ensure the bindings are true to underlying c-library.
Doing image comparison seems more an integration test, more suitable for FreeTypeAbstraction.jl or similar.
Where the actual drawing is part of the library. Here it is just a demonstration of how to make use of the bindings.

The grayscale conversion is in the ouline_emoji.jl example. Those do not contain any color. The color emoji generation is in the render_colrv1_emoji.jl example.

The reason i download the font, is to not have to deal with the font licencing.
FreeType download fonts in their test.
It seems that making a COLRv1 might be doable. I'll give it a try when i have some time on my hands.

Here's what i suggest:

  • Delete, or move my examples to an example/ folder. (render_colrv1_emoji.jl, render_outline_emoji.jl and render_word.jl)
  • Make a couple of unit (function) tests tests similar to what currently exists in runtests.jl.
    Though these will be minimal.

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.

Bump FreeType2_jll version to aid in getting emoji support

2 participants