Reputation: 1258
can't believe I don't know the answer to this already, but what happens if I use a font that a user then doesn't have installed.
So if I set a label to use Segoe UI and then a user on Win XP (who doesn't have Segoe UI already installed) runs the application. Does it throw an exception?
I know I can grab the system default font and use that for compatibility, but I'm wondering what happens if someone hasn't done that.
(Programming in C# .NET)
Thanks
Upvotes: 4
Views: 2618
Reputation: 627
According to this previous question, the MS Sans Serif font will be substituted if the font is missing.
Why is there no exception if using not existing font?
However, from personal experience, I've found that if a font is installed, but a style is missing, an exception will be thrown. In my case, I was somehow missing Verdana Regular, though I had Verdana, and exceptions were thrown when attempting to load that style.
Upvotes: 0
Reputation: 238
Exception will not be thrown, system will use default font instead. Similar question have been answered here: what happens if i use a font that isn't installed on the client machine
Upvotes: 2
Reputation: 9863
Like stated above you will not get an error. It will default to the standard font. The best way to handle this is to embed the font in your application.
The easiest way that I know how to do this is to open your program in Blend (free with visual studios) Then from here you can choose from a HUGE list of fonts. Once you find the one you want click embed. Thats it!
Here is a detailed explanation
http://msdn.microsoft.com/en-us/library/cc296385.aspx
Upvotes: 3