Posts: 652
Threads: 96
Joined: Apr 2022
Reputation:
22
I would like to use an "emoji" (or similar) in my programme. Is there a (simple) way to do this? I don't see any appropriate symbols in the ASCII code.
Posts: 652
Threads: 96
Joined: Apr 2022
Reputation:
22
04-21-2024, 03:39 AM
(This post was last modified: 04-21-2024, 03:45 AM by PhilOfPerth.)
Thanks Terry.
I found what I wanted in Wingding (a font I never expected to use).
I found I can change fonts mid-stream, but the new font seems to place the print position as 1,1.
I can fix this by using Locate r,c but wondered if there's a setting when using the new font that bypasses this?
Also, I only want to use one character, then revert to my old font. Is there a shorter way than re-re-setting my font?
Posts: 2,696
Threads: 327
Joined: Apr 2022
Reputation:
217
For a quick print of a single character, like your emoji, just use the above with a little helper code:
SUB PrintSmiley
f& = _FONT 'get the current font so we can restore it.
SafeLoadFont <whatever the handle is for the wingding font you loaded earlier in your code>
Print Chr$(<whatever the value is for the character>);
SafeLoadFont f& 'restore the current font back.
END SUB
Posts: 652
Threads: 96
Joined: Apr 2022
Reputation:
22
Thanks Steve.
I'll have a fiddle with that;
I don't really see much difference between that and just re-declaring my original font though.
Maybe the difference will become more obvious when I use it.
Posts: 476
Threads: 25
Joined: Nov 2022
Reputation:
45
Since we display unicode we should be able to display emojis? I know that we should be able to do this in terminals that support UTF-8. Just print out the unicode code point code to the terminal and it will display the emoji configured in the system? Or is this wrong?
Is it that when using a graphics screen mode the emojis will not render properly?
TBH I haven't tried to render an emoji in terminal yet. (the terminal must support it - windows terminal, xterm, mac terminal, etc. all do).