[Development] "font emojis", where are they processed?

René J.V. Bertin rjvbertin at gmail.com
Sat Mar 9 20:35:52 CET 2019


On Tuesday February 19 2019 23:23:45 Tor Arne Vestbø wrote:

Hi,

> > Grep qfontengine_coretext.mm for “ColorGlyphs”
> 
> The change: https://codereview.qt-project.org/#/c/47527/

I'm beginning to realise that the relevant difference between Qt4 and Qt5 isn't just in support for colour fonts. A number of the trouble emojis are in fact UTF32. To make matters worse, they "work" in some Qt4-based applications when you have the "Twitter Color Emoji" (*) font installed and use a Mac font like Menlo or Monaco as the intended font. This is based on a fallback mechanism provided by CoreText, apparently based on fallback information in the fonts, and apparently not requiring any action in Qt code (QCoreTextFontEngineMulti::stringToCMap() calling CTFontCreateForString()).

When instead you use just any font the emojis with a UTF8 or UTF16 representation are still rendered using that Twitter font but Qt4 now does have to call CTFontCreateForString(), in an implementation that looks like it wasn't designed with UTF32 in mind at all.

*) The version for Mac uses the same ID as Apple's colour emoji font, and will thus be used instead; the difference is that it also provides monochrome versions of all glyphs.

R.


More information about the Development mailing list