views:

381

answers:

2

As I'm working through an SL3/SL4 application, and starting to work with fonts, I'm finding a lack of documentation and best practices on font strategies. For example:

  1. Are there common fallback fonts for the supported font set (Arial, Comic Sans MS, etc.)? Is there a set of recommendations on fallback fonts between Windows and Macintosh systems?
  2. Are there Silverlight-supported fonts that will (almost always) be on an end-user system, or like 99.5% of the time, like "Times New Roman" or "Verdana", including Macintosh? Are there any sites that list this kind of information?
  3. Are there recommendations for accounting for Moonlight (Linux) views of SL apps and the fonts that are/aren't deployed with Linux systems?
  4. Is there a way to determine, in XAML or code-behind, if an end-user has a supported font on their system? I'd like this to run upon entry and then change the XAML as a result of findings to support the right font or allow an embedded one to load.
  5. In the documentation for supported fonts, it lists a bunch of fonts that "Silverlight text elements can use the following Latin fonts if available on the local computer.". Does this mean that if I use a font that is not in this list, such as "Cooper Black", and an end-user does have this font on their system, they will still need to download the font as embedded in my application?

Any links or pointers that can lead to at least some of the questions above answered would be very appreciated.

+2  A: 

I think you should split your ApplicationFonts into different packages using MEF (which will be included in the CLR of the upcoming Microsoft .NET Framework 4). So depending on the Users OS it should load the different Font Packages that you need to embed.

MarioEspinoza
This is a really good read, I didn't even know about MEF and I'm excited to try it out. I'll give you a +1 for this as it addresses my questions in part, but if you post this same answer over on my other question at http://stackoverflow.com/questions/2047726/multiple-out-of-browser-applications-in-one-application I'll give you full credit there. In partiular, a link off the link you gave is exactly what I was looking for: http://codebetter.com/blogs/glenn.block/archive/2009/11/29/mef-has-landed-in-silverlight-4-we-come-in-the-name-of-extensibility.aspx for Out-of-Browser experiences and MEF.
Otaku
Done, Glenn Block's Blog has a lot of useful tips.http://blogs.msdn.com/gblock/
MarioEspinoza
+3  A: 

Ok, here we go. These should get you closer to where you want to be:

  1. This is the same as CSS - you'll need to account for 'font stacks'. This is one of the best pages I've seen on the subject: Guide to CSS Font Stacks: Techniques and Resources
  2. This link is from November 2007 but it still has a great listing: Complete Guide to Pre-Installed Fonts in Linux, Mac, and Windows
  3. The link in #2 is the same - it covers Linux.
  4. Not sure about this one. Sorry :-(
  5. I believe that is correct, Silverlight only looks for fonts on the end user system that it will natively support. Otherwise, it will need to download the font.
Alison
Great links! That answers most of my questions.
Otaku