Font Choice

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
lohill
Posts: 770
Joined: Tue Dec 08, 2009 6:37 pm

Font Choice

Post by lohill » Tue Dec 25, 2012 6:25 am

I have developed an application on the Mac and have compiled it also for the PC. The version on the PC has really wimpy looking text due to what I assume to be the font substitution.. If I move the uncompiled application to the PC and look at it in the IDE the fonts look good. Is there one single font that looks good both in the Mac and the PC environment.?

Thanks,

Larry

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Font Choice

Post by Mark » Tue Dec 25, 2012 12:35 pm

Hi Larry,

You could use Helvetica, but it will look better if you write a little scripts that sets the font depending on the platform:

Code: Select all

on preOpenStack
  if the platform is "MacOS" then
    set the textFont of this stack to "Lucida Grande"
  else if the platform is "Win32" then
    set the textFont of this stack to "Tahoma"
  else // linux
    set the textFont of this stack to "Arial"
  end if
end preOpenStack
Additionally, you could check if the font is in the fontNames and use Helvetica if it isn't. If you have set different fonts for specific controls, then you need to extend the script to include those controls.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

lohill
Posts: 770
Joined: Tue Dec 08, 2009 6:37 pm

Re: Font Choice

Post by lohill » Tue Dec 25, 2012 8:45 pm

Thanks Mark and Merry Christmas.

Larry

wsamples
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 264
Joined: Mon May 18, 2009 4:12 am

Re: Font Choice

Post by wsamples » Wed Dec 26, 2012 12:29 am

Mark's advice is very good. You might refine it a little by looking at "systemVersion" in the dictionary. The default font in Vista and higher is Segoe UI. Use the same concept that Mark suggests but also test for systemVersion under the Windows platform. Tahoma is still provided but Segoe UI is preferred. Here is some additional info provided by Microsoft regarding fonts to use for apps sold in the Windows Store: http://msdn.microsoft.com/en-us/library ... 00394.aspx

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Font Choice

Post by jacque » Wed Dec 26, 2012 7:34 pm

Another option is to leave the font assignment empty. The engine will automatically use the system font. That lets your app remain compatible with any OS, even new ones you didn't anticipate later on.

Fonts will be inherited from higher-level objects, so to use this method you need to make sure that nothing higher in the object hierarchy has a font assigned. I.e., a button will inherit from the card, which inherits from the stack. Usually I don't assign fonts to anything. With the latest version of LiveCode you can assign text size and styles independently from the font, so you can still use those properties.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Font Choice

Post by Simon » Wed Dec 26, 2012 11:05 pm

Hi Jacqueline,
Do you have a "rule-of-thumb" for kerning issues or font size issues between platforms?
Like leave 1 character space in the field when developing on a Win machine, or something?

Thanks,
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Font Choice

Post by jacque » Wed Dec 26, 2012 11:37 pm

Simon,

I don't have any standard rules really. Sometimes I need to set the text size a point or two larger for Windows, which I do by setting the textsize of the stack so that it will inherit throughout. I tend to use wider fields than necessary for labels and avoid the inspector options that fit the control exactly to the text so that I never need to resize them. I usually set fixedLineHeight to true and leave a fairly generous line spacing. Mostly I just look at the stack on each platform and see what I need to tinker with.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Font Choice

Post by Simon » Wed Dec 26, 2012 11:46 pm

Hi Jacqueline,
Thanks, I guess I do the same.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply