Using private fonts with PDFsharp 1.50 beta or MigraDoc

Note: The FontResolver interface has changed between PDFsharp 1.50 beta 1 and PDFsharp 1.50 beta 2. This post describes the obsolete solution for PDFsharp 1.50 beta 1.
Sample code for PDFsharp 1.50 beta 2.

PDFsharp 1.50 beta 1 implements a new mechanism for private fonts (fonts that are not installed on the system). You simply implement IFontResolver and assign this to a global property:

// That's all it takes to register your own fontresolver
GlobalFontSettings.FontResolver = new DemoFontResolver();

The interesting part is IFontResolver and how you implement it.
Continue reading Using private fonts with PDFsharp 1.50 beta or MigraDoc