Getting into LiveCode for iOS? Ask your questions here.
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
Epidexia
- Posts: 8
- Joined: Tue Dec 30, 2014 5:49 am
Post
by Epidexia » Tue Nov 01, 2016 2:28 am
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.
-
[-hh]
- VIP Livecode Opensource Backer

- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
Post
by [-hh] » Tue Nov 01, 2016 4:21 am
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?
shiftLock happens
-
Epidexia
- Posts: 8
- Joined: Tue Dec 30, 2014 5:49 am
Post
by Epidexia » Tue Nov 01, 2016 5:47 am
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.
-
[-hh]
- VIP Livecode Opensource Backer

- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
Post
by [-hh] » Tue Nov 01, 2016 6:25 am
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 ?
shiftLock happens
-
jacque
- VIP Livecode Opensource Backer

- Posts: 7389
- Joined: Sat Apr 08, 2006 8:31 pm
-
Contact:
Post
by jacque » Tue Nov 01, 2016 4:36 pm
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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
-
Epidexia
- Posts: 8
- Joined: Tue Dec 30, 2014 5:49 am
Post
by Epidexia » Wed Nov 02, 2016 9:16 am
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.