Can LiveCode render unicode emoji world flags?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Monox18
Posts: 118
Joined: Tue Nov 25, 2014 9:48 pm

Can LiveCode render unicode emoji world flags?

Post by Monox18 » Thu Nov 04, 2021 6:52 pm

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?
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Can LiveCode render unicode emoji world flags?

Post by Klaus » Thu Nov 04, 2021 7:02 pm

Hi Monox,

hm, just tried your script and got the german flag in the field!?
Bildschirmfoto 2021-11-04 um 19.01.12.jpg
Bildschirmfoto 2021-11-04 um 19.01.12.jpg (12.24 KiB) Viewed 4779 times
Best

Klaus

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10098
Joined: Fri Feb 19, 2010 10:17 am

Re: Can LiveCode render unicode emoji world flags?

Post by richmond62 » Thu Nov 04, 2021 7:08 pm

SShot 2021-11-04 at 20.08.00.png
-
which may show as the letters DE on some platforms
Which operating system are you using?
-
SShot 2021-11-04 at 20.09.52.png
-
On MacOS 12 it does what it is supposed to do.

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Can LiveCode render unicode emoji world flags?

Post by Klaus » Thu Nov 04, 2021 7:11 pm

If you mean me: LC 9.6.4, macOS 10.14.6

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10098
Joined: Fri Feb 19, 2010 10:17 am

Re: Can LiveCode render unicode emoji world flags?

Post by richmond62 » Thu Nov 04, 2021 7:12 pm

No: I was wondering about the OP.
-
Oddly enough, LC 8.2.0 dp-2 serves up this:
-
SShot 2021-11-04 at 20.13.18.png

Monox18
Posts: 118
Joined: Tue Nov 25, 2014 9:48 pm

Re: Can LiveCode render unicode emoji world flags?

Post by Monox18 » Thu Nov 04, 2021 7:15 pm

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.
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10098
Joined: Fri Feb 19, 2010 10:17 am

Re: Can LiveCode render unicode emoji world flags?

Post by richmond62 » Thu Nov 04, 2021 7:18 pm

SShot 2021-11-04 at 20.18.05.png
-
I didn't choose any particular font at all.

Monox18
Posts: 118
Joined: Tue Nov 25, 2014 9:48 pm

Re: Can LiveCode render unicode emoji world flags?

Post by Monox18 » Thu Nov 04, 2021 7:21 pm

From your screenshots I guess the LC's Mac default font does support emoji flags whereas the LC's Window default font doesn't.
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10098
Joined: Fri Feb 19, 2010 10:17 am

Re: Can LiveCode render unicode emoji world flags?

Post by richmond62 » Thu Nov 04, 2021 7:25 pm

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

Monox18
Posts: 118
Joined: Tue Nov 25, 2014 9:48 pm

Re: Can LiveCode render unicode emoji world flags?

Post by Monox18 » Thu Nov 04, 2021 7:57 pm

Will keep that in mind. Thx for the responses guys
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/

Post Reply