Font Detection

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: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10428
Joined: Fri Feb 19, 2010 10:17 am

Font Detection

Post by richmond62 »

My Devawriter Pro has an inbuilt font detection routine:

Code: Select all

 if "Devawriter" is among the lines of the fontNames then
      add 1 to PHONTS
   end if
   if PHONTS > 0 then
      --do nix
   else
      GO TO CARD "FONT WARNING" of stack "DWPro"
   end if
Yesterday I modified the Devawriter.ttf font and swapped it out with the earlier version on MacOS 12.4,
and it was NOT detected:
-
fontB.jpg
-
The funny thing is that the stack works perfectly well displaying text inwith its fields using
the Devawriter.ttf font, BUT standalones BREAK because of
non-detection.
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10428
Joined: Fri Feb 19, 2010 10:17 am

Re: Font Detection

Post by richmond62 »

Blast!

The font editing program had changed the INTERNAL name of the Devawriter.ttf font to Devawriter Regular.

So . . . 'Happy People' . . . 8)

What is particularly nasty about this is that there is a mismatch between the font's surface name
and its internal name, which, without opening the font up in a font-editor and poking around
might not be known.
-
SShot 2022-04-26 at 10.26.05.png
-
My sense of humour is not all that elastic-sided in the morning before my second cup of coffee.
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10428
Joined: Fri Feb 19, 2010 10:17 am

Re: Font Detection

Post by richmond62 »

What is even funnier about this is that Fontforge reports my font as Devawriter-Regular,
but LiveCode 'sees' the font as Devawriter Regular (without a hyphen).

https://fontforge.org/en-US/
Post Reply