RFR: 8269806: Emoji rendering on Linux [v17]

Phil Race prr at openjdk.org
Wed Jan 25 18:44:49 UTC 2023


On Wed, 25 Jan 2023 13:22:31 GMT, Nikita Gubarkov <duke at openjdk.org> wrote:

>> It was implemented in JetBrains Runtime a year ago and was ported & refactored for this PR
>> It includes:
>> - Bitmap glyph loading via Freetype
>> - Manual scaling & transformation of bitmap glyphs with nearest-neighbor or bilinear-mipmap style algorithms depending on the text antialiasing hint
>> - Storing BGRA glyphs in glyph cache & rendering them as plain images, as currently used XRender text drawing functions doesn't support colored glyphs
>> - Small fixes in related code like null-checks which could cause NPE & comment typos
>
> Nikita Gubarkov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Skip tests if required font is absent

src/java.desktop/macosx/classes/sun/font/CCharToGlyphMapper.java line 92:

> 90: 
> 91:     private static int unicodeToUnits(int unicode, int dstOffset, char[] dst) {
> 92:         if (unicode >= 0x10000) {

Why can't you use public API that already does this ? [ ](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Character.html#toChars(int,char%5B%5D,int)) ?

src/java.desktop/macosx/classes/sun/font/CCharToGlyphMapper.java line 104:

> 102: 
> 103:     public int charToVariationGlyph(int unicode, int variationSelector) {
> 104:         if (variationSelector == 0) return charToGlyph(unicode);

We always use braces around the body, even for one line.

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

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



More information about the client-libs-dev mailing list