title: Load basefont from resource
body: <p>I'm trying to use ITextSharp and load a font file inserted in my project as resource.</p>
  
  <p>I try different solutions but none of them seems to work, here a sample of what I did:</p>
  
  <p>this one cannot load the resource</p>
  
  <pre><code>  private static BaseFont _bfArial;
      public static BaseFont BfArial
      {
          get
          {
              if (_bfArial == null)
                  _bfArial = BaseFont.CreateFont(@"Resources\Images\arialuni.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
  
              return _bfArial;
          }
      }
  </code></pre>
  
  <p>this one gives me an error: "'Identity-H' is not a supported encoding name."</p>
  
  <pre><code> private static BaseFont _bfCourier;
      public static BaseFont BfCourier
      {
          get
          {
              if (_bfCourier == null)
                  _bfCourier = BaseFont.CreateFont("Courier", BaseFont.IDENTITY_H, BaseFont.EMBEDDED, true, FontsResources.cour, null);
  
              return _bfCourier;
          }
      }
  </code></pre>
  
  <p>and here the way I add the files in my solution</p>
  
  <p><img src="https://i.stack.imgur.com/aQ8d8.png" alt="enter image description here"></p>
  
  <p>Can you please help me solving this issue? thank you</p>
  
  <p>Andrea</p>