Page 1 of 1
Font Choice
Posted: Tue Dec 25, 2012 6:25 am
by lohill
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
Re: Font Choice
Posted: Tue Dec 25, 2012 12:35 pm
by Mark
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
Re: Font Choice
Posted: Tue Dec 25, 2012 8:45 pm
by lohill
Thanks Mark and Merry Christmas.
Larry
Re: Font Choice
Posted: Wed Dec 26, 2012 12:29 am
by wsamples
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
Re: Font Choice
Posted: Wed Dec 26, 2012 7:34 pm
by jacque
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.
Re: Font Choice
Posted: Wed Dec 26, 2012 11:05 pm
by Simon
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
Re: Font Choice
Posted: Wed Dec 26, 2012 11:37 pm
by jacque
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.
Re: Font Choice
Posted: Wed Dec 26, 2012 11:46 pm
by Simon
Hi Jacqueline,
Thanks, I guess I do the same.
Simon