title: How to set a new different font while converting HTML to PDF using ITEXTRenderer
body: <p>I am trying to convert a HTML into a PDF. In HTML i have some symbols which are not showing up in PDF document. While debugging i found that &amp;#8209 or &amp;#x2011 character is not available in any of the default fonts available in the IText library. My HTML doesnt have Arial Unicode MS in its font family, and because of that even if i add that font to my itext renderer it doesnt work.So i am trying to find out during the creation a PDF can we do it with a font that is not mentioned in the HTML? 
  Sample HTML:</p>
  
  <pre><code>&lt;html lang="en"&gt;
      &lt;title&gt;Sample HTML&lt;/title&gt;
      &lt;body&gt;
          &lt;div style="font-family:Arial, Helvetica, sans-serif; font-size:14px; line-height:23px; color:#3F3F3F; font-weight:normal; "&gt;Please call this 
              number in case of emergency,  123&amp;#x2011;456&amp;#x2011;7890.
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Java Code :</p>
  
  <pre><code>@Component
  public class PDFConverter {
  
  @Autowired
  private Tidy tidy;
  
  @Autowired
  private ITextRenderer renderer;
  
  @Autowired
  private Gson gson;
  
  public String pdfBox(byte[] bytes) {
      byte[] outDoc = null;
      String pdf = null;
      try {
          ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
          String html = new String(bytes);
          String xhtml = toXHTML(html);
          InputStream is = new ByteArrayInputStream(xhtml.getBytes("UTF-8"));
          ITextFontResolver  resolver = renderer.getFontResolver();
          Document doc = tidy.parseDOM(is, null);
          renderer.setDocument(doc, null);
          resolver.addFont("*filepath*/ARIALUNI.TTF", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED); 
          renderer.layout();
          renderer.createPDF(outputStream);
          outDoc = outputStream.toByteArray();
          pdf = Base64.getEncoder().encodeToString(outDoc);
          renderer.finishPDF();
          outputStream.flush();
          outputStream.close();
      } catch (DocumentException | IOException e) {
          e.printStackTrace();
      }
  
      return pdf;
  }
  
  private String toXHTML(String html) {
      final org.jsoup.nodes.Document document = org.jsoup.Jsoup.parse(html, "UTF-8");
      document.outputSettings().syntax(org.jsoup.nodes.Document.OutputSettings.Syntax.xml);
      document.outputSettings().prettyPrint(false);
      document.outputSettings().charset("ASCII");
      document.outputSettings().escapeMode(EscapeMode.xhtml);
      return document.html();
  }
  </code></pre>
  
  <p>}</p>