Page 1 of 1

Unicode blip

Posted: Tue Mar 08, 2022 11:45 am
by richmond62
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 3211 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 3211 times
-
when what it should give me is this (mockup):
-
JainOM.png
JainOM.png (952 Bytes) Viewed 3211 times
-
I wonder why.

Re: Unicode blip

Posted: Tue Mar 08, 2022 1:07 pm
by richmond62

Re: Unicode blip

Posted: Tue Mar 08, 2022 1:32 pm
by richmond62
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].

Re: Unicode blip

Posted: Tue Mar 08, 2022 1:56 pm
by richmond62
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.

Re: Unicode blip

Posted: Wed Mar 09, 2022 12:27 pm
by richmond62
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

Re: Unicode blip

Posted: Wed Mar 09, 2022 1:17 pm
by richmond62
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.

Re: Unicode blip

Posted: Sat Mar 12, 2022 9:32 pm
by richmond62
This now seems to have been sorted out:
-
Yo.jpg