Unicode blip

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
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Unicode blip

Post by richmond62 » Tue Mar 08, 2022 11:45 am

So, messing around as one does with Unicode with this sort of code:

Code: Select all

on mouseUp
   put numToCodePoint(57357) into fld "ff"
end mouseUp
with my Devawriter font I get this:
-
Screen Shot 2022-03-08 at 12.39.01 PM.png
Screen Shot 2022-03-08 at 12.39.01 PM.png (3.6 KiB) Viewed 2224 times
-
Which is lovely, and exactly what I expect to get'

However this:

Code: Select all

on mouseUp
   put numToCodePoint(43261) into fld "ff"
end mouseUp
gives me this:
-
Screen Shot 2022-03-08 at 12.40.41 PM.png
Screen Shot 2022-03-08 at 12.40.41 PM.png (3.06 KiB) Viewed 2224 times
-
when what it should give me is this (mockup):
-
JainOM.png
JainOM.png (952 Bytes) Viewed 2224 times
-
I wonder why.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Unicode blip

Post by richmond62 » Tue Mar 08, 2022 1:07 pm


richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Unicode blip

Post by richmond62 » Tue Mar 08, 2022 1:32 pm

Interestingly enough LiveCode has no problem displaying unicode glyphs
43248 - 43259 but goes wrong with 43260 - 43263 from my .ttf font Devawriter.
-
Screen Shot 2022-03-08 at 2.21.23 PM.png
-
Choosing Tamil Sangam those glyphs do display:
-
Screen Shot 2022-03-08 at 2.21.50 PM.png
-

What is also interesting is that

Code: Select all

put the fontNames
gives me a list of fonts that is far, far larger than the number of fonts in my MacOS systems 2 font folders

[For instance, I cannot locate the font Tamil Sangam anywhere].

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Unicode blip

Post by richmond62 » Tue Mar 08, 2022 1:56 pm

gives me a list of fonts that is far, far larger than the number of fonts in my MacOS systems 2 font folders
Oh, look, it's Richmond's favourite hobby: answering his own questions . . .

Tamil Sangam and Co. are 'Library Fonts'.

So there are 3 locations where MacOS (10.7.5 in this specific case) stores fonts, not 2:

/Users/username/Library/Fonts

/System/Library/Fonts

/Library/Fonts

Mind you that still doesn't solve my problem.

Tamil Sangam does NOT contain that range of glyphs, so MacOS is being "too clever for
its own good" (or for my purposes at least) substituting those glyphs in from somewhere
else.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Unicode blip

Post by richmond62 » Wed Mar 09, 2022 12:27 pm

HOWEVER: this is obviously a LiveCode fault as Libreoffice has no
problem whatsoever displaying that glyph from my font:
-
Screen Shot 2022-03-09 at 1.25.53 PM.png

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Unicode blip

Post by richmond62 » Wed Mar 09, 2022 1:17 pm

https://www.mail-archive.com/use-liveco ... 06685.html

"When a character (codepoint) in a string is displayed, if the
requested font does not have that codepoint the OS substitutes a glyph from
another font (or the missing character glyph if no font supports the
codepoint). So for example if you change the font of the above flag of Scotland
to Arial, it still displays as the flag of Scotland, even though this glyph is
not in Arial. LC will still report that the font of this character is Arial:
from what I can gather this is not the fault of LC, the OS is doing this
substitution behind its back (TextEdit does the same). But is there any way to
find out (programatically) the actual font being used? "

Well, LiveCode does not seem to function as well as it should in this respect.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Unicode blip

Post by richmond62 » Sat Mar 12, 2022 9:32 pm

This now seems to have been sorted out:
-
Yo.jpg

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”