title: How to embed font in PDF created from HTML with iText and Flying Saucer?
body: <p>I have problem with embedding Polish fonts into PDF converted from HTML.</p>
  
  <p>My HTML code have style in body:</p>
  
  <pre><code>&lt;BODY style="font-family: Tahoma, Arial, sans-serif;font-size : 8pt;"&gt;
  </code></pre>
  
  <p>I tried 2 ways of converting such HTML into PDF:</p>
  
  <ul>
  <li>FOP with htmlcleaner</li>
  <li>iText with flying-saucer</li>
  </ul>
  
  <p>For FOP I can add all used fonts into its config file and then created PDF have those fonts embedded (if font is used in HTML). In resulting PDF I have Tahoma font in Identity-H encoding. It looks good -- all Polish letters are displayed as expected.</p>
  
  <p>Then I tried such conversion with iText: seems simplier because I do not need to create transformation for every HTML. Unfortunately I don't know how to embed used fonts into resulting PDF. Most examples I found create PDF from scratch and I don't know how to apply those methods to the Flying Saucer ITextRenderer or other object used in conversion.</p>
  
  <p>My current code tries to add fonts in <code>PDFCreationListener.preOpen()</code> by getting <code>ITextFontResolver</code> and adding font <code>fs.addFont(path, true);</code>. But all .pdf I create do not have fonts I want.</p>
  
  <p>The second problem is that result PDF do not have Polish letters. Is it problem in Flying Saucer or in iText? Acrobat shows that created PDF document uses Helvetica with Ansi encoding and ArialMT as font. I think this Ansi encoding is not good. How can I set Polish encoding (Identity-H)?</p>