Cross-Platform Development

I write mostly for the OS X platform but also compile and distribute the same Apps for Microsoft Windows. I just bought a Raspberry Pi and just for fun, decided to try to compile my code for it. To my shear amazement, it loaded and ran just fine with one caveat. It didn’t look very good. Specifically, the fonts for the controls and labels were too big and some were cut off or hidden.

My question is 1.) are there some general guidelines available for cross-platform development? And 2.) Are there specific fonts recommended for use in cross-platform development?

Linux, in general, has bigger default fonts which means the controls are bigger. Two ways to get around this from my experience. The first is to subclass all your controls and change their height in the Open even if on Linux. Use conditional compiles to do it like this:

#if TargetLinux me.height = me.height + 10 //I forget what the value should be so use as example #endif

The other method, which I prefer, is the go into System preferences and make the default system text a lot smaller. Preferences->SystemSettings->System. Roboto 9 seems to work okay.

The second method is a lot simpler than the first, IMO.

There might be some other tricks out there but these are the two I know.

Better stick with System for cross platform development. But be aware that baseline is not the same on each platform. So when you have finished development on Mac, it is good to do the last mile on Windows for Windows builds to make sure it looks good. Which is relatively easy in a VM.

Of course, a real PC is best to judge the final result, especially to see if it does not flicker too much.

Here are some interesting links that might be helpful:

Cross platform Tips
UI Design Tips

…a take off on Bob’s idea above, you could also do this for all controls at once, in the window open event I believe.