Updating Your Windows 8 App to Windows 8.1: Dealing With Coloured Fonts

With Windows 8.1, font characters (glyphs) can now contain coloured layers.

In a Windows 8.0 app, this XAML:

<TextBlock>$★☺☹❤✈⛱⛺⛵⚽✘✔☀⛅☕⛄❓♀♂❋❄✹</TextBlock>

Will produce the following (black and white) characters:

image

In Windows 8.1 this behaviour is different by default.

The same XAML in a Windows 8.1 app will produce coloured glyphs:

image

If you’re retargeting an existing app, this new default behaviour may not be what you want.

To turn colouring off and emulate the Windows 8.0 appearance, set the TextBlock’s IsColorFontEnabled to false, for example:

<TextBlock IsColorFontEnabled="False">$★☺☹❤✈⛱⛺⛵⚽✘✔☀⛅☕⛄❓♀♂❋❄✹</TextBlock>

To read more about this, check out the MSDN docs.

Pingbacks and trackbacks (1)+

Add comment

Loading