RFR: 8269806: Emoji rendering on Linux [v18]

Nikita Gubarkov duke at openjdk.org
Wed Feb 1 23:09:33 UTC 2023


On Wed, 1 Feb 2023 22:39:48 GMT, Nikita Gubarkov <duke at openjdk.org> wrote:

>> I thought so, but now you made me doubt. Anyway, I will read the code, recall this and will let you know what I find.
>
> Well, what I did find so far:
> * Segoe UI Emoji does have `FE0F` UVS (colored selector), but no `FE0E` (monochrome).
> * Segoe UI Symbol doesn't have any UVS.
> 
> So fonts alone will not guide us to a correct glyph.
> However, we can ignore COLR table and render base glyphs from Segoe UI Emoji to achieve monochrome effect, so we actually can have both mono/color inside Segoe UI Emoji alone (but we would still have to determine whether to use mono or color ourselves).
> But these base glyphs are not the same as in Segoe UI Symbol and I can clearly see that every Windows app which respect variation selectors, renders monochrome ones using Segoe UI Symbol, not base glyphs from Segoe UI Emoji.
> 
> I will try to investigate this further, but so far it looks to me like to support variation selectors the way native apps do, we need to use some kind of hardcoded tables, like those exclusion ranges, because:
> 1. We don't know whether character must be draw mono/colored by default, fonts doesn't tell us, only CLDR does.
> 2. Even if we somehow know the default variant, looking for `FE0F` selector will lead us to to Segoe UI Emoji, but `FE0E` - nowhere.
> 
> Ideas?

So I restored the original idea.
1. Place Symbol into main font sequences to preceed the Emoji and be able to have exclusion ranges
2. Exclude everything that should be colored by default
3. One more hack in composite mapper - ignore exclude ranges when variation selector is specified

Results:
* No selector, default mono: will be handled by Symbol
* No selector, default color: skip Symbol because excluded, handle by Emoji
* FE0F (color): skip Symbol because it doesn't define mapping for this selector, handle by Emoji
* FE0E (mono): skip Symbol & Emoji & remaining fonts because they don't define this selector. No glyph found, so try again without selector, but ignoring exclusion ranges - handle by Symbol

-------------

PR: https://git.openjdk.org/jdk/pull/4798



More information about the client-libs-dev mailing list