title: Loading a Font with PdfSharp .Net Standard preview from Xamarin.Forms fails: No appropriate font found
body: <p>I am currently assessing how to generate a PDF from Xamarin.Forms (currently running the app on Android, only) and checking the <a href="https://github.com/Didstopia/PDFSharp" rel="nofollow noreferrer">.NET Standard port of PdfSharp</a>.</p>
  
  <p>Drawing to the PDF and showing it works, but I'm having issues writing text to the document. When I am trying to load an <code>XFont</code> with the following code</p>
  
  <pre><code>var font = new XFont("sans-serif", 20);
  </code></pre>
  
  <p>it fails with the exception</p>
  
  <blockquote>
    <p>System.InvalidOperationException: No appropriate font found.</p>
  </blockquote>
  
  <p>According to <a href="https://github.com/roceh/PdfSharp.Xamarin/tree/master/Samples" rel="nofollow noreferrer">these</a> samples, it is supposed to work this way, but they are for PdfSharp.Xamarin and not the PdfSharp .NET Standard. According to <a href="https://stackoverflow.com/a/13329907/2249175">this answer</a> the <code>"sans-serif"</code> font family should be correct, but I've desperately tried other options, like <code>"Roboto"</code>, but to no avail.</p>
  
  <p>Is PdfSharp for .NET Standard compatible with Xamarin at all? (It lists PdfSharp.Xamarin as a source it has been created from, hence I assumed it.) Is there anything else I have missed? </p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I tried PdfSharp.Xamarin and it did work. Obviously this is an issue with the .NET Standard port.</p>