iBicha / EmojiTexture

A Unity plugin to render Emojis ☺ ❤ 🍆 🍑 to a texture
Other
62 stars 9 forks source link

[EmojiTexture v2] SkiaSharp/HarfBuzzSharp integration #25

Open iBicha opened 5 years ago

iBicha commented 5 years ago

Motives: When I first created this plugin, I wanted to keep away from all the complexities related to font/ glyphs, rendering, and so on, and leave that for the underlying OS to do the heavy lifting. This resulted in a flaky implementation that had platform specific bugs (and even per os version).

What's next: The superior solution was to implement a library that is capable of loading emojis straight from color font files and render them directly. The implementation was delayed because of many posts/news about TextMesh Pro was in progress with such features. But since the wait got too long, and the lack of a good solution is becoming frustrating to some people, I resumed working on this.

The how: The idea is to leverage a combination of great libraries (FreeType/Harfbuzz/Cairo SkiaSharp/HarfBuzzSharp) that do this pretty well, and use that for EmojiTexture. This will allow better flexibility, quality and performance in the future.

Currently in the TODO list:

Screen Shot 2019-03-26 at 2 01 14 AM Screen Shot 2019-03-26 at 2 02 47 AM

Sidenote: TextMesh Pro will have colored glyphs with Unity 2019.2, and compatible with 2019.1, according to the roadmap (https://youtu.be/qwGjneorKgs?t=2742). It sounds like this feature is not going to be supported on earlier versions of Unity.

iBicha commented 5 years ago

I will be trying to avoid Cairo to avoid licensing restrictions. I'm pretty sure some people are not willing to disclose the source of their games so they can support emojis. Can FreeType and HarfBuzz be enough to render all kind of color fonts correctly? To be continued...

iBicha commented 5 years ago

SkiaSharp just had its newer package HarfBuzzSharp updated to a newer version of HarfBuzz. If this handles emoji modifiers correctly, it could be the way to go. Update: SkiaSharp will be the backend of EmojiTexture v2.