Roadblock in the way of migrating the proof-of-concept Silverlight XPS reader [SimpleSilverlightXpsViewer sample does not work on Silverlight 2 RTW]

This blog has moved to a new location and comments have been disabled.

All old posts, new posts, and comments can be found on The blog of

See you there!

Comments (11)
  1. In this issue: Shawn Wildermuth, Laurence Moroney, Dave Relyea, Mike Taulty, Andy Beaulieu, Brad Abrams

  2. silverlightkb says:

    Silverlight 2 can still load fonts from Isolated Storage, right? Can you expand the fonts in embeded XPS into the isolated storage before loading them?

  3. silverlightkb says:

    Sorry, my comemnts was incorrect. I cannot load fonts from isolated storage with FontUri.

  4. David Anson says:


    I’ve not considered the IsolatedStorage angle, but I think may boil down to the same thing as the following exchange I had with someone else (paraphrased slightly):

    Them: Note that you can download a font via WebClient or whatever and set it from code, it’s just that it won’t be downloaded automatically by the runtime.

    Me: So how would that work? Are you suggesting the FontSource constructor that takes a Stream? I think I considered this briefly and then dismissed it when I saw that only TextBlock, TextBox, and PasswordBox use FontSource (per Reflector). The Glyphs class does not – and I think that still leaves me up a creek. Did you have something else in mind?

    Them: Darn.

  5. David Anson says:


    It looks like our replies crossed paths. But it seems we came to the same conclusion. 🙁

    Thank you very much for the idea – every bit helps!

  6. Fix for Simple XPS Silverlight Viewer for Silverlight 2

  7. silverlightkb says:

    Delay, I found a way to make it work (though not ideal). The fix is to package all the fonts in a separate XAP and load it dynamically. See my blog entry

  8. David Anson says:


    Congratulations on your creative solution! 🙂 I think what you’ve done is a great approach for controlled scenarios because it’s more flexible than alternative proposals that require fonts to be embedded directly in the viewer application itself. However, as I note above, I’m still hoping to be able to achieve the goal of a stand-alone viewer that works on unmodified XAP files (and avoids points 1 and 2 in your post) – but until then, yours is a very nice step in the right direction! Thanks!!

  9. I’ve recently been involved on a project that has a requirement to create and view XPS documents in Silverlight. 

  10. slyi says:

    Could you use SL3 local font support to avoid the font packaging.

  11. David Anson says:


    I’m not sure that you could. (FYI, I don’t know what your attachment is and I didn’t download it.) Specifically, an XPS file can contain ANY font in the world and you’d really like for that font to be used when rendering the relevant portions of the document. Because there’s no guarantee that random font exists on the local machine, I’m not sure that local fonts solve the entire problem – though I agree they seem to improve the situation!

Comments are closed.

Skip to main content