I’m building a .net application with windows forms. I’m pondering on the following problem: If I specify fonts in my application that are available only in Vista and Office 07, what will happen when the application tries to run in a machine without these ?
I suppose the system won’t be able to fall back to a font of it’s family, since they are initialized internally using strings (eg ‘Segoe UI’).
What’s the best practice to follow, such that I will still be able to specify fonts through the forms designer and not worry about things like this breaking ?
I think it’s
System.Drawing.SystemFonts.MessageBoxFontthat gives Segoe UI, Tahoma, then MS Sans Serif depending on the OS. As long as your layout is fluid enough—WPF is good at this, but in Windows Forms it’s much harder—then it’ll work great. Regardless, it’d be worth using that setting then testing in VMs to see if it works.Also rather unfortuantely the designer doesn’t have support for setting the font like that, and it will reset things to hard-coded Segoe UI sometimes (if you’re using Vista).
This kind of thing was actually one of the reasons I’m starting to move to WPF :).