locked
How to get fonts out of XPS to use in FlowDoc's

    Question

  • Hi, my app reads XPS documents that contain a sequence of XML files containing flows/sections/paragraphs along with the usual set of fixed pages.  The flow XML documents are fed to a call to XamlReader.Load() and used to create FlowDocuments in memory.  The Flow, Section, Paragraph tags have FontFamily attributes which we need to come from the fonts included in the XPS file.  I cannot get this to work.  Interestingly, if I modify the FontFamily tags to point to on-disk font files, (e.g. FontFamily=file:///c:/mydir/MyFont.TTF#My Font) this works.  I tried manually constructing a ParserContext object and including that in the call to XamlReader.Load() but that didn't help.

    Is this possible and where to start?

    Thanks.

    Monday, August 16, 2010 7:33 PM