Search code examples
c#windows-phone-8colorscharacterwinrt-xaml

Segoe UI Symbol emoji character not displaying in colour on Windows Phone 8.1


On Windows Phone 8, the following xaml displays an emoji character in colour:

<TextBlock 
    FontFamily="Segoe UI Symbol"
    TextOptions.DisplayColorEmoji="True"
    Text="smilie's unicode that I don't have off-hand"/>

However, when this code is run on Windows Phone 8.1, the emoji's background colour is unfilled. That is, it's not got a yellow background; the emoji's outlines are only coloured.

So, for example, it looks like this in Windows Phone 8.0:

enter image description here

But it looks like this in Windows Phone 8.1:

enter image description here

I've seen that Windows Phone 8.1. introduces a new "IsColorFontEnabled" property. I don't know if this fixes it on 8.1, but I do know in order to use it, I must migrate the app to 8.1, which I don't want to as I want to keep 8.0 backward compatibility for the time being.

So, is there a way to have a Windows Phone 8.0 Silverlight app that uses a color emoji, that would also display it in colour on Windows Phone 8.1?


Solution

  • In Windows Phone 8.1, We can use IsColorFontEnabled in TextBlock to display emoji with colour. IsColorFontEnabled is type of Boolean, and it's default value is false(means don't display colour). But if you set FontFamily="Segoe UI Symbol", the colour emoji also don't display.

    The sample code like this:

    <TextBlock IsColorFontEnabled ="True" Text="I am a TextBlock 😀"/>
    

    And If you don't want to re-target your project to Windows Phone 8.1, Just remove FontFamily="Segoe UI Symbol" , like this:

    <TextBlock TextOptions.DisplayColorEmoji="True" Text="I am a TextBlock 😀"/>
    

    Because if you set fontfamily to Segoe UI Symbol, the emoji will be displayed as character.