Page 1 of 1

Cross Platform & Fonts

Posted: Thu Aug 16, 2007 5:05 pm
by andyh1234
I am just working on my first app.

I have a text field with multiple lines, on the Mac it is perfect, but when I compile to Windows the text field shrinks widthways.

Are there any fonts that work on both Mac and Windows to create the same effect.

Posted: Thu Aug 16, 2007 8:12 pm
by Mark
Hi andyh1234,

Three years ago, there was a long discussion about cross-platform fonts on the Revolution User Mail List. The Bitstream Vera fonts were suggested as a good platform font. You can find the entire font family here:

http://www.december14.net/fonts.shtml

and a few smaller packages here:

http://ftp.gnome.org/pub/GNOME/sources/ ... vera/1.10/

You can include Vera with your open-source products or distribute it separately for use with "third-party" products.

Besides Vera, you can always use Courier New, Helvetica, Times New Roman, Arial and Verdana on both Mac OS X and Windows. However, unlike Vera, these fonts may look slightly different on different platforms.

If you find more fonts that are feasible for cross-platform use, please tell us!

Best,

Mark

Posted: Fri Aug 17, 2007 10:48 am
by andyh1234
Thanks for that, ill give it a go!

Oddly enough, there seems to be another way that makes little sense, but works for me for now.

Selecting good old 'Arial' and formatting everything up on the mac, when it comes to compiling the app it still looks great on the mac as you would expect, but goes to bits when the compiled app is viewed on the pc.

BUT, if I open the same .rev stack using the PC editor, it looks just like it does on the mac. I can then compile it there for the PC and it works and the exe works and looks like it should.

The conclusion therefore seems to be a problem happening when the mac creates the stand alone version for the pc, it appears the line heights and character widths just dont get preserved, but they do if you compile on the pc.

Following on from that, I compiled a mac version on the pc and it would not even open on my mac, so it just looks like there is some work to be done there! As long as I compile the rev file on the platform I want to use it on, its fine.

In the meantime it looks like if I want to carry on with Revolution (which is great), Ill have to buy a dual platform license :(

Posted: Fri Aug 17, 2007 11:01 am
by Mark
Hi Andyh1234,

First of all, this sounds like a bug to me, because text style management shouldn't be this difficult, even if cross-platform. If one uses Arial on Mac, one should see Arial on Win in the correct styles and sizes. I think that I am seeing the same when moving tacks from Mac to PC and back, so you might want to report this to the QCC.

Second, if you set the textFont of all cards and objects to empty and set the textFont of the stack to Arial, all objects will use Arial. This will make it easy to add a script that sets the textFont for the entire stack. You might want to write another script, for example in preOpenCard handlers, which sets the textStyles, textHeights etc.

Using scripts, you can avoid having to develop on 2 different machines and having to buy a dual platform license.

Also, void using profiles in the standalone settings. They don't seem to work properly.

Best,

Mark

Posted: Fri Aug 17, 2007 6:16 pm
by FourthWorld
> If one uses Arial on Mac, one should see Arial on Win in the correct
> styles and sizes.

True enough, but even with TrueType fonts the metrics differ from platform to platform, so kerning and even M-square can differ enough to make text wrap quite differently on each platform.

There are a few open source fonts available in which the designer has put in the effort to better ensure identical metrics on all platforms. But of course this means adding the font installation to your installer, and assumes the user doesn't mind that.

In most of my apps I go the other direction, using HIG-compliant fonts wherever appropriate, designing for flexibility in the UI to accommodate the differences. On Mac this means Lucida Grande 11 and 13, and on Vista it means Segoe UI 9 and 12. I set these at the stack level, as you noted, so they get inherited by any control that needs the default.

Fortunately most controls share similar sizing and leading across platforms, close enough that setting the font and size gives an appearance substantially conformant with user expectations on the target platform.

The only area where this has been problematic has been the relatively few cases where block text needed to be wrapped at specific line breaks. For those I usually just but in hard returns, and make the field wide enough to accommodate the wider of the two.

No matter how you deal with fonts, there remains the bigger challenge: What to do if the user changes their display settings to use "Large Fonts".

Posted: Fri Aug 17, 2007 11:03 pm
by Garrett
FourthWorld wrote:No matter how you deal with fonts, there remains the bigger challenge: What to do if the user changes their display settings to use "Large Fonts".
Which can completely and utterly destroy an interface if you're not prepared for it.

~Garrett