faq8825
[[faq8825]] last edit on Oct 18, 2006 10:32 AM by thomas_hoevel

Can I use PostScript fonts with PDFsharp?

PDFsharp cannot work with PostScript fonts. Only TrueType fonts and OpenType fonts with TrueType outlines can be used with PDFsharp.

Background

The PostScript font technology was invented by Adobe in 1984. Since 1990 to 2000 the Adobe Type Manager must be installed to use PostScript under Windows. For Windows 2000 and Windows XP (and the according Server editions) Microsoft licensed the Adobe TypeManager and integrated it into GDI. PDFsharp is based on GDI+, that was originally developed by Microsoft for internal use in Microsoft Office. The public version of GDI+ that comes with Windows XP (as gdiplus.dll) and the .NET framework (in the System.Drawing namespace) cannot handle PostScript fonts. PDFsharp was designed to draw on all windows, printers and PDF pages. Therefore it is based internally on GDI+ and cannot handle PostScript fonts.

In Windows Vista, the Windows Presentation Foundation (WPF) and in the Extended Paper Specification (XPS) the use of Adobe Type Manager is completely excluded. If you use a PostScript font it is simply replaced by a bitmap image.

Some people think that OpenType solves this problem. This is not true, because an OpenType font is (very roughly spoken) just a unified container of either a TrueType or a PostScript font. As an example the font manager of Windows XP reports "OpenType with TrueType Outlines" for most fonts that come with Windows and "OpenType with PostScript Outlines" for fonts that come e.g. with the Adobe Creative Suite. GDI+ can only handle OpenType fonts with TrueType Outlines.

Workaround

The best you can do if you have a PostScript font and you want to use it with PDFsharp is to convert it into a TrueType font.
A reliable tool for conversion is TransTypePro from FontLab.
Because of mathematical reasons the hinting table of a font cannot be completely transformed from PostScript hinting to TrueType hinting. That leads to less readable glyphs on computer displays.
On printers with 300 dpi or more this effect becomes invisible.

On the to-do list of PDFsharp is the idea to use the converted TrueType font under Windows and the original PostScript font in the PDF file. It is not yet implemented because we don't need it so far.