I am looking to add the Font(Myriad Pro) to the PDF Invoice generated via PDFsharp, but unable to do so.
What I have tried so far is:
EZFontResolver.cs
class-file provided by a developer on the following linkGlobalFontSettings.FontResolver = fontResolver;
1.50.xx
The font resolver is a global setting (as user "spender" pointed out in their comments). This global settings is shared by all instances of PdfDocument() and it can be set only once.
The font resolver is a new feature of PDFsharp 1.50 (there was a breaking change with beta 2, so samples for beta 1 may no longer work with the current beta 3). For PDFsharp 1.32 a different approach must be used.
When using the WPF build of PDFsharp 1.32, you will find a sample that shows the usage of private fonts in the samples folder that comes with the source package of PDFsharp (sample folder is PrivateFonts).