title: How can iText embed font used by JFreeChart for chart title and labels?
body: <p>I'm using Linux machine with iText and JFreeChart. I noticed after embedding a chart that Helvetica font (un-embedded) now appears in the PDF file. Here's the code I'm using:</p>
  
  <pre><code>import com.itextpdf.text.Font;
  
  // create chart using JFreeChart
  final XYPlot plot = jchart.getXYPlot();
  final LogAxis xAxis = new LogAxis("x axis");
  final NumberAxis yAxis = new NumberAxis("y axis");
  ...
  java.awt.Font cFont = new java.awt.Font("/home/fonts/jigsaw.otf",java.awt.Font.PLAIN,10);
  xAxis.setLabelFont(cFont);  // set axis label font
  ...
  
  // add chart to PDF
  PdfTemplate chart = canvas.createTemplate(chartWidth, chartHeight);  
  Graphics2D  g2d1 = new PdfGraphics2D(chart, chartWidth, chartHeight);
  Rectangle2D r2d1 = new Rectangle2D.Double(0,0,chartWidth,chartHeight);
  jchart.draw(g2d1, r2d1); 
  g2d1.dispose();
  canvas.addTemplate(chart,document.left(),100);
  </code></pre>
  
  <p>The font jigsaw.otf is not observed in the PDF that gets created, although the font size of 10 (derived from <code>cFont</code>) is used (and changing this value does control the Helvetica font size that gets substituted here).</p>
  
  <p>My ultimate goal is to embed all fonts. This means either (1) embedding jigsaw.otf so that Helvetica does not appear un-embedded, or (2) embedding Helvetica and forgetting about using jigsaw.oft. Either is acceptable, as long as I can control the font size used in the JFreeChart chart. </p>
  
  <p>How to do it (simplest method)? </p>
  
  <p>There's a section in iText book 2nd edition 14.5.2 "Drawing text to PdfGraphics2d", but I believe that is adding text to an existing graphic, rather than embedding the text used by JFreeChart in its chart. Correct me if I'm wrong. Quite confused. Hoping someone can provide a simple example how it's done.</p>