I have a very confusing problem about unicode support in the generated pie chart in my pdf. Here is what I have: I am generating pie chart (with jfreechart library) that need to add superscripts on the title of the pie chart. I tested and I know that jfreechart is generating correct title (superscripts are fine) and I also tested itext unicode support. There is a Graphics2D (from java awt) in between which turns the jfreechart into a template and then I can print this template into my pdf. according my tests I guess problem should be in between graphics2d and itext template.
PdfContentByte canvas = writer.getDirectContent();
PdfTemplate template = canvas.createTemplate(width, height);
FontMapper mapper = new DefaultFontMapper();
template.setFontAndSize(mapper.awtToPdf(new java.awt.Font("Arial Unicode MS", java.awt.Font.PLAIN, 7)) , 7);
Graphics2D graphics2d = template.createGraphics(width, height);
graphics2d.setFont(new java.awt.Font("Arial Unicode MS", java.awt.Font.PLAIN, 7));
JFreeChart chart = getPieChart("", title, value);
I found out the problem. Problem is template (PdfTemplate) does not show the unicode character. Although I embedded unicode fonts and set it for template, still not working. any ideas?