Page 1 of 1
Can LiveCode render unicode emoji world flags?
Posted: Thu Nov 04, 2021 6:52 pm
by Monox18
Hello all,
I'm recieving some JSON data from a webpage. It contains the Unicode for a flag as well as the .png image. I would like to know how to display the emoji unicode in a field (hopefully without the .png!)
Code: Select all
"flag": "https://ipdata.co/flags/de.png"
"emoji_flag": "\ud83c\udde9\ud83c\uddea",
"emoji_unicode": "U+1F1E9 U+1F1EA"
With
https://r12a.github.io/app-conversion/ I found out the decimal integers of the unicode are 127465 127466. So I tried:
Code: Select all
put numtocodepoint(127465) & numtocodepoint(127466) into fld "Field"
But the field show the "DE" letters instead of the flag colors. Is there any way of properly rendering the flag?
Re: Can LiveCode render unicode emoji world flags?
Posted: Thu Nov 04, 2021 7:02 pm
by Klaus
Hi Monox,
hm, just tried your script and got the german flag in the field!?

- Bildschirmfoto 2021-11-04 um 19.01.12.jpg (12.24 KiB) Viewed 4789 times
Best
Klaus
Re: Can LiveCode render unicode emoji world flags?
Posted: Thu Nov 04, 2021 7:08 pm
by richmond62
-
which may show as the letters DE on some platforms
Which operating system are you using?
-
-
On MacOS 12 it does what it is supposed to do.
Re: Can LiveCode render unicode emoji world flags?
Posted: Thu Nov 04, 2021 7:11 pm
by Klaus
If you mean me: LC 9.6.4, macOS 10.14.6
Re: Can LiveCode render unicode emoji world flags?
Posted: Thu Nov 04, 2021 7:12 pm
by richmond62
No: I was wondering about the OP.
-
Oddly enough, LC 8.2.0 dp-2 serves up this:
-
Re: Can LiveCode render unicode emoji world flags?
Posted: Thu Nov 04, 2021 7:15 pm
by Monox18
Using Windows 10 Home LC 9.6.5 RC 1. Do you know which font should I use for the field? hopefully one of the default ones.
Also I just found out that I can install BabelStone Flags custom font from
https://www.babelstone.co.uk/Fonts/Flags.html and now it displays the flag.
Re: Can LiveCode render unicode emoji world flags?
Posted: Thu Nov 04, 2021 7:18 pm
by richmond62
-
I didn't choose any particular font at all.
Re: Can LiveCode render unicode emoji world flags?
Posted: Thu Nov 04, 2021 7:21 pm
by Monox18
From your screenshots I guess the LC's Mac default font does support emoji flags whereas the LC's Window default font doesn't.
Re: Can LiveCode render unicode emoji world flags?
Posted: Thu Nov 04, 2021 7:25 pm
by richmond62
Probably.
NOW, if you are proposing to export your stack with Emoji flags to run on other computers you had better
be careful to
EMBED a font that displays emoji fonts.
https://stackoverflow.com/questions/159 ... in-a-stack
Re: Can LiveCode render unicode emoji world flags?
Posted: Thu Nov 04, 2021 7:57 pm
by Monox18
Will keep that in mind. Thx for the responses guys