Page 1 of 1

Font not rendering in Livecode 8

Posted: Tue Nov 01, 2016 2:28 am
by Epidexia
Hi I'm using the following code to change the font of various fields;

Code: Select all

   if the environment ="mobile" then
      put "HelveticaNeue" into gDefaultFont
      put "HelveticaNeue-Medium" into gDefaultFontBold
      put "HelveticaNeue-Light" into gDefaultFontHelp
      put "HelveticaNeue-Thin" into gDefaultFontMainTitle
      put "HelveticaNeue-Italic" into gDefaultFontDiagnosticsItalic
      put "AvenirNextCondensed-Medium" into gDefaultFontButton
      put "AvenirNextCondensed-UltraLight" into gDefaultFontCalendarLabel
   else
      put "Helvetica Neue" into gDefaultFont
      put "Helvetica Neue Medium" into gDefaultFontBold
      put "Helvetica Neue Light" into gDefaultFontHelp
      put "Helvetica Neue Thin" into gDefaultFontMainTitle
      put "Helvetica Neue Italic" into gDefaultFontDiagnosticsItalic
      put "Avenir Next Condensed Medium" into gDefaultFontButton
      put "Avenir Next Condensed Ultra Light" into gDefaultFontCalendarLabel
   end if

   set the textFont of field "XYZ" to gDefaultFontCalendarLabel
When I build the app using Livecode Commercial 6.7.11 the fonts get rendered as expected. When I use Livecode Indy 8.1.1 the fonts revert to the default font even though when I check "textFont" the answer matches the font from the list above. I'm building for iOS9.2

I'm using standard fonts from the iOS font list. Can anyone shed some light? Is there a difference between Livecode 8.1.1 and 6.7.11 in the way fonts are rendered?

TIA AA.

Re: Font not rendering in Livecode 8

Posted: Tue Nov 01, 2016 4:21 am
by [-hh]
Hi.

Setting the textFont doesn't check if the font is available, you can set that property to virtually any string and LC then takes the fallback if the font is not loaded/ loadable.

You could try to check the fontnames? And which of your font names are among the lines of the fontnames? Did you change in between the language settings of your system?

Re: Font not rendering in Livecode 8

Posted: Tue Nov 01, 2016 5:47 am
by Epidexia
Hi HH,

Yes, I checked the fonts all of the ones listed are available and no I didn't change the language settings. It's the same app compiled under 6.7.11 and 8.1.1. The latter behaves differently so I'm wondering what has changed in 8.

Re: Font not rendering in Livecode 8

Posted: Tue Nov 01, 2016 6:25 am
by [-hh]
The whole text system has changed ('improved' TMHO) a lot from LC 6 to LC 8.
There were problems with native fonts in Android but I haven't seen that in iOS.

If I'm wrong, could please someone come in who's more specialized than me?

If you get no answer here within a day, could you then make a small sample stack that shows the effect (for example with a simple text field and your font-settings) and report to LC QCC = quality.livecode.com ?

Re: Font not rendering in Livecode 8

Posted: Tue Nov 01, 2016 4:36 pm
by jacque
I vaguely recall an old post that said internally iOS refers to font names differently than the name of the font file. You need to use the internal names.

Put a handler in the stack that does "answer the fontnames" and see if the names there are the same ones you expect.

Re: Font not rendering in Livecode 8

Posted: Wed Nov 02, 2016 9:16 am
by Epidexia
That's the strange part. When I put the "answer the fontnames" in the code the results were the same on the desktop, the simulator and the iPad.

Avenir Next Condensed Medium came up as "Avenir Next Condensed Medium" instead of "AvenirNextCondensed-Medium" as I was expecting for the Simulator and the iPad.

So I changed the code to use the 'spaced' version and it made no difference whatsoever. The fonts still defaulted to whatever the standard default font is for iOS.