I am using a webapp on azure to create a PDF using PDFsharp 1.32. As it is a Azure webapp I cannot install fonts.
Therefore I am using the following with embedded font options:
var globalFontCollection = XPrivateFontCollection.Global;
_fontBytes = File.ReadAllBytes(_pathToFont);
globalFontCollection.AddFont(_fontBytes, _fontName);
However this does not work. There is no error just acts as if the font is not known and falls back to the default. If I install the font it works so I know the rest of the code is correct.
Other code shows using AddFont with different parameters however those are not available to me and looking at the source code this is the only implemented method.
Does anyone know the correct code to allow us to use non installed fonts?