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

Try the base codepoint without the color attribute :

:writing_hand:

Hmm. I guess there’s no one.

Thank you but I don’t understand “Base codepoint”.

This emoji has 2 codepoints, one for the symbol (hand with pencil) and one for a color attribute (skin color). The base codepoint is &u270f as

Var hand As String = &u270f

But I see it rendered as a yellow one and not B&W in Windows. So it wasn’t working.

I may have fixed it, see this:

var handWithPen As String = &u270d+&ufe0f
Button1.Caption = x

My button rendered as:

image

1 Like

Now there’s another mess. I’ve tried a dark skin variation as

var x As String = &u270d+&u1f3fe
Button1.Caption = x

And the result was the same:

image

So Xojo is not rendering it as expected.

hank you for your test Rick, if I do:
MySegmentedButton.SegmentAt(0).Caption = &u270d
it is an emoji, not a black&white as I want. :confused:

I see. And to get things worse this control does not have a paint event to create drawing workarounds using pictures.

If the character is in Segoe UI Symbol AND in Segoe UI Emoji , then the Emoji one is used.
I have then to use symbol characters which are not in Emojis.

I can’t see where to set a font in a segmented button. But I’ve found a static graphics workaround.

Edit the segments, clear the label, load a png icon.

Later you can change the icon by any 16x16 Picture object like

Me.SegmentAt(1).Icon = any_available_icon

I’m not sure if it’s Xojo’s fault. Below 2 screencaptures under Windows, one with SegoeSymbol and the second with SegoeEmoji. The code for “Hand been writing” is the same: U+270D and they are displayed as identical under the application Bloc-notes.exe .



and this one under TextEdit.app (Mac OS):
SC-Mac

Then, maybe Xojo should add a property to the control which would be only available under Windows: “Use Emoji (if exist) instead of Blanck&White Symbol”

Probably if you could set the font and size of chars of the label of a segment you could handle it if you find a font that renders it B&W. So it may be a Xojo “feature” no being able to choose the B&W charset variant, if one exist.

Here is a workaround that could solve your problem. You can implement this solution by creating a Method or just placing the following code under a pushbutton. This should provide a quick and efficient solution to the issue you are experiencing.

var WritingHandString as string = &U270d
var b as integer = 100

dim image as Picture = New picture(b1.5,b1.5)
dim g as Graphics = image.Graphics

image.Graphics.FontSize = b
image.Graphics.FontName =“Segoe UI Symbol”
image.Graphics.drawingcolor = color.Black

image.Graphics.Drawstring(WritingHandString, 0,b)

SegmentedButton1.SegmentAt(0).Icon = image
SegmentedButton1.Refresh

'canvas1.Backdrop = image
'canvas1.Refresh

I have recently come across some information that may be helpful.