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.
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?
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.
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
But do you think it is related to needing to be that specific font Segoe UI Emoji?
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…
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.
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 …
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.
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 )
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.
It seems that only the web project is able to show emoji in color, the PC/desktop version only shows in black even if you use the right font.
In my desktop project I did this to get these in color.
I’m currently working on a desktop project (Windows) and wanted to share some updates with you. It’s been an interesting challenge and I’m happy to report that the problem we were experiencing has been resolved with the new Xojo version 2024 R2. After updating to this version, everything seems to be working as expected.
And I have another problem, I don’t use Emojis (color) on my Mac application because I want them black&white but under Windows, the hand with the pen is a colored Emoji (it is a SegmentedButton).