What are multicolor fonts in Windows 8.1?

Posted: (EET/GMT+2)

 

As long as I can recall, font display in Windows has been mainly a single-color approach: you specify the font, the character(s) you want to display, and the color. Sure, you could use various tricks to make the characters multi-colored, but inherently fonts always use the color specified by the application code: they are uncolored by nature.

With Windows 8.1's text rendering and font improvements, this is changing. In Windows 8.1, OpenType fonts can support two new tables called COLR and CPAL, which can be used to render multicolor fonts! Very nice! An example font "Segoe UI Emoji" is part of Windows 8.1 and this font supports these new colored characters.

What is the use of such multicolor characters, then? The first use is in emoticons ("emojis"), but there's a wide usage scenario for these multicolor fonts as well: application icons. Since font glyphs can be freely scaled and can look good both when small and large, they are good candidates for application icons. This is better than PNG images (say) or vector graphics, especially if you need to have the icons in various sizes.

Currently, this is Microsoft's own implementation of multicolor fonts, but they have submitted a proposal to the OpenType standardization board, and others believe that Microsoft's implementation is better than Apple's or Google's because it doesn't rely on bitmaps.

For more information, you can also check out Charles Petzold's example in XAML.

If you are developing Windows Store applications with XAML, you can use multicolor fonts straightaway in apps running on Windows 8.1. Simply use a suitable control, such as TextBlock, and set the font to Segoe UI Emoji. Then, type in some suitable icons (using Character Map for example), and they get rendered in color!

If you want to disable these colors in your fonts, simply set the property IsColorFontEnabled to false.

Hope this helps!