Color Emoji in Unity: Flags, Skin Tones and ZWJ Sequences

Last reviewed

Short answer

Many emoji are not one character but a sequence: a family is several people joined by zero-width joiners, a flag is a pair of regional-indicator letters, and a skin tone is a modifier after the base emoji. TextMesh Pro has no shaping engine, so these sequences render as one glyph only when the emoji font happens to encode them as plain ligatures; otherwise they fall apart into separate pictures, letters or empty boxes.

UniText renders color emoji from the operating system's emoji font with no setup, and flags, ZWJ sequences and skin tones form single glyphs as the Unicode standard requires.

Why some emoji break

Unicode builds a large share of emoji from several code points. A text engine has to recognize the whole sequence and ask the emoji font for the one glyph that represents it.

EmojiWhat it is made ofWithout sequence support
πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦ familyman + ZWJ + woman + ZWJ + girl + ZWJ + boyfour separate people
πŸ‘πŸ½ skin tonethumbs up + medium skin tone modifiera yellow thumb and a color swatch
πŸ‡―πŸ‡΅ flagregional indicator J + regional indicator Ptwo boxed letters
πŸ‘©β€πŸ’» professionwoman + ZWJ + laptopa woman next to a laptop
❀️ red heartheart + variation selector 16a black text-style heart

Since com.unity.ugui 2.0, TextMesh Pro can draw color emoji from a color font asset listed under Fallback Emoji Text Assets in the TMP Settings. The same page lists its limits: no single or chained contextual substitution, no SVG or AAT emoji fonts, and no support for the 160 px JPEG strikes of Apple Color Emoji. With no shaping engine, a family, flag or skin-tone sequence becomes one glyph only if the emoji font encodes it as a plain ligature and the ligature feature is on. Operating-system emoji fonts are used only through Dynamic OS font assets created and added to the fallback lists by hand.

UI Toolkit uses the same color-font setup and does not support COLRv1 fonts; its documentation does not describe emoji sequences.

How UniText renders emoji

Family, profession and skin-tone sequences composed from the device's emoji font, each drawn as one cluster.
  • Color emoji come from the operating system's emoji font by default: for example Segoe UI Emoji on Windows, Apple Color Emoji on Apple platforms and Noto Color Emoji on Android. Nothing has to be configured or shipped.
  • Flags, ZWJ sequences such as families and professions, and skin-tone modifiers each form one glyph cluster.
  • Emoji take part in line breaking, selection and editing as single clusters: one arrow-key press crosses a whole family emoji and one backspace deletes it.
  • Emoji work inside right-to-left text and next to any script.
  • A project can ship its own color font instead: UniTextColorFont accepts CBDT and sbix bitmap fonts and COLRv0 and COLRv1 vector fonts.
  • On WebGL, emoji are drawn through the browser's own emoji rendering.

Color emoji can be turned off for the whole project in Project Settings β€Ί LightSide β€Ί UniText β€Ί Disable Emoji.

Questions

Do emoji add to the build size?

Not by default. The system emoji font is read from the device, so no emoji images or font files go into the build unless you add your own color font.

Can players type emoji in input fields?

Yes. Emoji entered through the system keyboard or emoji picker are edited as whole clusters, so the caret never lands inside a sequence.

Will emoji look the same on every platform?

No. Each platform draws its own emoji design. To get one design everywhere, add a color font of your choice to the font stack.

Check it in your project

Run the browser demo, follow the setup guide, or compare the free version with the licenses.

Related problems