Emoji Support
On this page
Overview
With version 1.61, Gameface adds support for certain types of emoji fonts. Emojis and colored text glyphs can enhance the visual fidelity of any Web component that includes displaying text. Gameface can now load fonts that contain emoji characters and use them in any text context.

Details
Supported emoji font types
COLRV0
There are multiple ways that fonts can encode emoji glyphs. One of these ways is with a COLRV0 table. Officially, we support the following emoji fonts:
EmojiTwoCOLRv0
– source repository of the fontOpenMojiCOLRv0.ttf
– source repository of the fontTwemojiCOLRv0.ttf
– source repository of the fontSegoe UI Emoji
– this font comes with Windows
Gameface should still be able to load any font file that contains emojis in the COLRV0
format.
COLRV1
Another more modern way of how emoji glyphs are stored in a font file is the COLRV1 table. This format of color glyphs supports more graphics features like gradients and more complex blending between parts of the glyphs. This further increases the visual fidelity of color glyphs like emojis. The COLRV1
format is considered a replacement for the old way of storing a whole SVG for every glyph in a font file. Compared to SVGs COLORV1 stored glyphs offer more optimal use of storage memory and less complex rendering.
Gameface supports loading and using font files with color glyphs encoded in the COLORV1
font table.

The officially supported COLORV1
fonts are:
Noto Color Emoji
– source repository of the font
Gameface should still be able to load any font file that contains emojis in the COLRV1
format.
COLORV1
format. Most font files that support color emojis and other color glyphs do so by storing the glyph data as an SVG inside the font file. Also, the tools for authoring fonts with color glyphs might be unable to export font files with COLORV1
stored glyphs and rely on the SVG format. For situations like these, it is important to remember that Gameface does not support color glyphs stored as SVGs. However, there is a way to workaround this limitation of Gameface. The nanoemoji utility can be used to convert SVG font files to COLRV1
ones. In general, shipping font files with an SVG table should be avoided as this would waste storage memory due to the raw SVGs stored in the file.COLORV0
and COLORV1
tables to store the same color glyph. In this case, Gameface will prefer to render the glyph through the COLORV1
table.Usage
The emoji fonts can be loaded as any other font.
After this, emojis can be added to the HTML in various ways:
<body>
<!-- With manual unicode code -->
🎟
<!-- With pasted unicode character -->
😀
</body>
Emoji fonts can also be used in conjunction with other fonts.
<style>
body {
font-family: Droid Sans, EmojiTwo;
}
</style>
Gameface will first try displaying the text characters with Droid Sans
and only the emoji glyphs will be rendered through the EmojiTwo
font.