title: iText, What's going on with Font, BaseFont and createFont()?
body: <p>There is a lot of mystery to me about what is going on with font and basefont. Especially when it comes to the constructor. The iText website gives this line as example code for new fonts</p>
  
  <pre><code> BaseFont unicode = BaseFont.createFont("c:/windows/fonts/arialuni.ttf", 
                          BaseFont.IDENTITY_H, 
                          BaseFont.EMBEDDED);
  </code></pre>
  
  <p>I can get this call to work:</p>
  
  <pre><code>BaseFont bf = BaseFont.createFont(BaseFont.COURIER, BaseFont.CP1257, 
                    BaseFont.EMBEDDED);
  </code></pre>
  
  <p>But if I replace BaseFont.CP1257 with say BaseFont.HELVETICA then it doesn't work and I get a page that says "failed to load pdf document."</p>
  
  <p>I tried looking through the class file and I can't seem to figure out what that second parameter is (I'm assuming it is something like a backup font in case the first font doesn't work, like in HTML) and I can't figure out why some fonts would work and not others.</p>