I am rendering emoji in SkiaSharp and have been able to get it to work correctly for simple emoji (like or ) but not more complex emoji (like or ).
The trickiest part was setting the correct typeface containing the emoji since there is no support for fallback fonts as noted here: https://github.com/mono/SkiaSharp/issues/232
Here is a simplified version of the code I am using:
int GrinningFaceEmoji = 0x1f600;
void DrawEmoji(SKCanvas canvas, string emoji, int x, int y) {
SKPaint paint = new SKPaint();
paint.Typeface = SKFontManager.CreateDefault().MatchCharacter(GrinningFaceEmoji);
canvas.DrawText(emoji, x, y, vtsm.paint);
}
When emoji
is a simple emoji, it works perfectly, but more complex emoji show up as multiple-characters. The light baby shows as two characters - the yellow baby followed by a color square. The artist shows as three characters. I am currently testing this on macOS.