Emoji are displayed as black and white only on DesktopRadioButton.Caption and DesktopSegmentedButton

I am trying to jazz up my project by using some emojis in some RadioButton.Caption and in a DesktopSegmentedButton. On Mac, they are displayed in color, but on Windows, they display in black and white.
Screen Shot 2022-12-21 at 10.48.40 am
Screen Shot 2022-12-21 at 12.20.28 pm
Screen Shot 2022-12-21 at 12.39.05 pm

From this article https://www.tjvantoll.com/2016/06/15/emoji-on-windows/ it suggests that color emojis are only shown if the font is set to Segoe UI Emoji.

However I have tried changing the font of the RadioButtons in the Opening event and it makes no difference.

#If TargetWindows
  Var emojifont As String = "Segoe UI Emoji"
  //FontAvailable is a function in a global module that iterates through System.FontAt
  If FontAvailable(emojifont) Then
    Me.FontName = emojifont 'The font is available and this line runs
  End If
#EndIf

Is there something different I should be doing or do Xojo built apps just not display color emojis on Windows?

Thanks,
Frank

That reminds me something, but my memory is not clear on that.

It had to do with the moment you change attributes. If it’s done too soon, the css file will override the changes. You need to do the changes after Xojo applies the css styles.

I hope that will ring a bell to someone else.

He did mention Desktop controls, so css may not come into play, but it could still be a timing issue. Try moving that code to the Window’s Opening event or even to a short-period timer you start from window opening. Don’t know if it will make a difference, but it’s worth a shot.

Thanks for the suggestions. I tried moving the code to the Window.Opening event and also chucked in some RadioButton.Refresh(True) for good measure but unfortunately no luck :stuck_out_tongue:

But do you think it is related to needing to be that specific font Segoe UI Emoji?

On further Googling, this article Microsoft Emoji List — Emojis for Windows 11, Windows 10 and Xbox (emojipedia.org) states that

Emojis from Microsoft are supported on PCs and tablets running Windows 11, Windows 10, as well as Xbox. There were also available on Windows phones prior to them being discontinued. These are provided by the Segoe UI Emoji font, although some applications continue to show black and white emojis from an earlier release.
As of the Windows 11 November 2021 update, the platform includes the new Fluent emoji design set that was first previewed ahead of 2021’s World Emoji Day. Windows 10’s last emoji update was the May 2019 Update, which supported emoji from up to early 2019’s Emoji 12.0.

I don’t have any knowledge of how fonts work – whether it has more to do with the operating system or to the application – but I suspect that Xojo just doesn’t support color emojis on Windows yet. Oh well, it doesn’t affect my apps functionality. I’ll live… :kissing_smiling_eyes:

Ah, variations in emoji are common in fonts. Some platforms do a simple mono outline and others coloured. You are also likely using System font on each platform, which could come out differently on Mac and Windows. There’s no easy way of knowing exactly which font is being used on each platform when you select System. It likely also depends upon the version of the OS in question.

Certainly on the Mac different fonts have different representations on the emoji. For example I needed a globe emoji for my help system, because of the new key on the latest Macs. I had to switch to an alternate font for it to prevent it being blue and 3 dimensional.

The problem you could face is that changing the font for each platform is easy, changing it for one segment is no so simple. I’m not even sure it is possible.

… or just include the font you need for this with your app. Just make sure to license it!

Oh boy not for Desktop applications. A reboot of my mind was required !

Looks like this bug report covers this black and white emojis on Windows issue …

https://tracker.xojo.com/xojoinc/xojo/-/issues/63604

I’m seeing the same issue on Linux (Both “Ubuntu 22.04.2 LTS” and Raspberry Pi OS (“Raspbian GNU/Linux 11 (bullseye)”).

This is after doing a lot of reading and installing the Google Noto Color Emoji font again and editing fontconfig files - no luck - all emoji icons are black and white.

Both of the Linux hosts correctly show the emojis in Google Chrome and Chromium as the correct color versions which seems to indicate the color emoji font is available to apps that correctly reference it …

https://unicode.org/Public/emoji/latest/emoji-test.txt

Tested Xojo 2023r1 today for ARM 32 build on “Raspbian GNU/Linux 11 (bullseye)” - issue not fixed, emojis are still black and white. They are displayed correctly (full color) on MacOS.

justin@rpi-host:~ $ more /etc/os-release
PRETTY_NAME=“Raspbian GNU/Linux 11 (bullseye)”
NAME=“Raspbian GNU/Linux”
VERSION_ID=“11”
VERSION=“11 (bullseye)”
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL=“http://www.raspbian.org/
SUPPORT_URL=“RaspbianForums - Raspbian
BUG_REPORT_URL=“RaspbianBugs - Raspbian

I wonder if @William_Yu has any thoughts on this issue?

Related: The Xojo blog article - " Using Emojis in Xojo" … Using Emojis in Xojo – Xojo Programming Blog

I narrowed it down further: Listbox (which my app requires) on RPi is the issue - it displays the same string with color emojis as black and white but a label with the same string is correctly displayed with the color versions.

dim mEmojiStr as String = "Justin Testing ♈ 🤩"

EmojiLabel.FontSize = 32

EmojiLabel.Text = mEmojiStr

EmojiListBox.AddRow( mEmojiStr )

Works correctly on MacOS:

On Windows, in a text box, it’s following the Text Color

1 Like

I’ve added a link to RichEditD2D Window Controls - Math in Office on to #63604 - Windows Textarea, Textfield and Graphics do not support color emojis

My only thought is that this sounds like a bug with Graphics.DrawText on Linux. Since the color emojis show up just fine with Labels, TextFields, TextAreas, etc. then Graphics.DrawText (which the ListBox utilizes) should likely do the same.

Hi @William_Yu - Thanks for the reply! Turns out that it’s even more broken on Windows 10 (Built with Xojo 2023r1, x86 64 Bit) - label are also black and white, not color as they should be.

I’ve been testing on each OS that they correctly display color emojis on this page in Chrome or Chromium: https://unicode.org/Public/emoji/latest/emoji-test.txt

How do we submit bugs now?

Win10-Emoji-Test

1 Like

I think your particular issue (at least on Windows) already has a ticket. You can track that, as well as create new ones here: https://tracker.xojo.com/xojoinc/xojo/-/issues/63604