title: Font issue with PDFtk
body: <p>I'm having difficulties filling in a form using <code>pdftk</code> with text fields with true type fonts.</p>
  
  <ul>
  <li>Font files (.ttf) are added to /Library/Fonts (OSX Mavericks)</li>
  <li>The form is created with Adobe Acrobat Pro</li>
  <li>The form includes normal (non form) text using these fonts</li>
  <li>The form text fields also use these fonts</li>
  <li>The form can successfully be filled and printed using Adobe Acrobat Pro and even Preview</li>
  </ul>
  
  <p>However, <code>pdftk</code> throws an error when trying to fill it using the command:</p>
  
  <pre><code>pdftk ./my_form.pdf fill_form my_data.fdf output ./the_output.pdf
  </code></pre>
  
  <p>The output is:</p>
  
  <pre><code>Unhandled Java Exception in create_output():
  java.lang.ArrayIndexOutOfBoundsException: 0
     at pdftk.com.lowagie.text.pdf.DocumentFont.fillEncoding(pdftk)
     at pdftk.com.lowagie.text.pdf.DocumentFont.doType1TT(pdftk)
     at pdftk.com.lowagie.text.pdf.DocumentFont.&lt;init&gt;(pdftk)
     at pdftk.com.lowagie.text.pdf.AcroFields.getAppearance(pdftk)
     at pdftk.com.lowagie.text.pdf.AcroFields.setField(pdftk)
     at pdftk.com.lowagie.text.pdf.AcroFields.setFields(pdftk)
  </code></pre>
  
  <p>If I change the font of the text inputs to Helvetica, Times Roman or Courier, <code>pdftk</code> will successfully create a PDF. Oddly though, Arial and Georgia also throw the same error.</p>
  
  <p>I have tried to no avail to embed the fonts in the PDF using Ghostscript as suggested in this question <a href="https://stackoverflow.com/q/12857849/120606">How to repair a PDF file and embed missing fonts</a>. <code>gs</code> may have embedded the fonts, but it removes the form fields so the resulting PDF can't feed back into <code>pdftk</code>.</p>
  
  <p>A working resolution would be greatly appreciated.</p>