Embedded Exotic Fonts

Dec 20, 2011 at 11:27 AM

I have a PDF document that displays normally using the Adobe Reader. However, when parsed and displayed using the Document Toolkit's PDF extensions the text does not appear in the rendered XAML.

What could be the cause of this anomoly? The fonts that are embedded also seem to be partial fonts if that helps.

Graham J McDonald

Dec 20, 2011 at 11:38 AM

Hi Graham,

PDF font support is currently only partially implemented. Document Toolkit's PDF engine tries to use a fallback mechanism when an unsupported font is found, but this doesn't cover all font scenarios. If you run the PDF engine in VS2010 in debug mode, the Visual Studio Output pane displays details about font usage and provides information when an unsupported font is found and skipped.

I'm using my spare time to gradually improve the PDF text rendering stack. No guarantees on when or whether the font stack will be fixed. 

- Koen

Dec 20, 2011 at 2:02 PM
Edited Dec 20, 2011 at 2:09 PM

Hi Koen,

I did as you suggested but I do not see the information about the fonts that you mention above. Where does the fallback mechanism take place in the code?

When the font is present and no message appears, why would the text fail to be displayed?


Dec 21, 2011 at 11:47 AM

Hi Graham,

Font substitution is handled in the StandardType1Font.CreateSubstituteFont method. All font related classes are found in the FirstFloor.Document.Pdf.Fonts namespace.

The rendering of text is done in the PageParser.RenderGlyphs method. Whenever an unsupported fonts is detected, a message is written using Debug.WriteLine.

- Koen