How to draw emoji with full color using SDL2_ttf?

Indeed, SDL_ttf doesn’t look at the colors that comes with the font.

You can try to add a new function in SDL_ttf to request and build the palette for a specific emoji.
Maybe this is the good example to follow: https://www.freetype.org/freetype2/docs/reference/ft2-layer_management.html#ft_get_color_glyph_layer

Once you have the palette, you can use one of the SDL_ttf shaded functions that give you a surface with a palette format. Set your new palette to this surface and hopefully this will work.

1 Like