@@ -252,8 +252,10 @@ public int getNumGlyphs() {
252
252
return EmojiFont .this .getNumGlyphs ();
253
253
}
254
254
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
+ }
257
259
boolean slot = getSlot (unicode , variationSelector );
258
260
CharToGlyphMapper mapper = slot ? emoji : symbol ;
259
261
if (mapper != null ) {
@@ -274,12 +276,27 @@ public int charToVariationGlyph(int unicode, int variationSelector) {
274
276
275
277
@ Override
276
278
public int charToGlyph (int unicode ) {
277
- return charToVariationGlyph (unicode , 0 );
279
+ return getGlyph (unicode , 0 , false );
278
280
}
279
281
280
282
@ Override
281
283
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 );
283
300
}
284
301
}
285
302
}
0 commit comments