Greetings,
I am generating reports in 9 different languages, so for simplicity I am using the Arial Unicode MS font for everything, which contains all characters I could possibly need.
The problem arises when I try to bold or italicize the font for export to a pdf. I can either use the Arial Bold fonts etc. - at which point none of my special characters show up - or I can stick with the Unicode MS, but all the bold/italic formatting is ignored.
Is there any way around this? Thanks in advance.
I am generating reports in 9 different languages, so for simplicity I am using the Arial Unicode MS font for everything, which contains all characters I could possibly need.
The problem arises when I try to bold or italicize the font for export to a pdf. I can either use the Arial Bold fonts etc. - at which point none of my special characters show up - or I can stick with the Unicode MS, but all the bold/italic formatting is ignored.
Is there any way around this? Thanks in advance.
2 Answers:
Posted on September 15, 2006 at 4:08pm
If you don't want to use bold/italic PDF fonts, you can use the FONT_MAP export parameter to instruct the PDF exporter to "simulate" bold/italic fonts.
Your code should be something like this:
Your code should be something like this:
Code: |
<br /> Map fontsMap = new HashMap();<br /> map.put(new FontKey("Arial Unicode", true, false), new PdfFont("ArialUnicode.ttf", "Cp1252", embedded, true, false));<br /> map.put(new FontKey("Arial Unicode", false, true), new PdfFont("ArialUnicode.ttf", "Cp1252", embedded, false, true));<br /> //etc<br /> pdfExporter.setParameter(JRExporterParameter.FONT_MAP, fontsMap);<br /> </td></tr></tbody></table><br /> <br /> HTH,<br /> Lucian |