Skip to content

Commit 887e8e8

Browse files
committed
fixup! JBR-8282 Port 8353230: Emoji rendering regression after JDK-8208377
1 parent 86b631c commit 887e8e8

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

src/java.desktop/windows/classes/sun/font/EmojiFont.java

+21-4
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,10 @@ public int getNumGlyphs() {
252252
return EmojiFont.this.getNumGlyphs();
253253
}
254254

255-
@Override
256-
public int charToVariationGlyph(int unicode, int variationSelector) {
255+
private int getGlyph(int unicode, int variationSelector, boolean raw) {
256+
if (!raw && FontUtilities.isDefaultIgnorable(unicode)) {
257+
return INVISIBLE_GLYPH_ID;
258+
}
257259
boolean slot = getSlot(unicode, variationSelector);
258260
CharToGlyphMapper mapper = slot ? emoji : symbol;
259261
if (mapper != null) {
@@ -274,12 +276,27 @@ public int charToVariationGlyph(int unicode, int variationSelector) {
274276

275277
@Override
276278
public int charToGlyph(int unicode) {
277-
return charToVariationGlyph(unicode, 0);
279+
return getGlyph(unicode, 0, false);
278280
}
279281

280282
@Override
281283
public int charToGlyph(char unicode) {
282-
return charToGlyph((int) unicode);
284+
return getGlyph(unicode, 0, false);
285+
}
286+
287+
@Override
288+
public int charToGlyphRaw(int unicode) {
289+
return getGlyph(unicode, 0, true);
290+
}
291+
292+
@Override
293+
public int charToVariationGlyph(int unicode, int variationSelector) {
294+
return getGlyph(unicode, variationSelector, false);
295+
}
296+
297+
@Override
298+
public int charToVariationGlyphRaw(int unicode, int variationSelector) {
299+
return getGlyph(unicode, variationSelector, true);
283300
}
284301
}
285302
}

0 commit comments

Comments
 (0)