JasperReports PDF font name (default in jasperreports.properties)

Michael Holst picture Michael Holst · Sep 2, 2011 · Viewed 10.1k times · Source

I'm trying to get JasperReports to embed a font present in the JasperReports fonts jar (from a DynamicJasper-generated report). I have this configured in the jasperreports.properties:

net.sf.jasperreports.default.pdf.font.name=DejaVu Sans
net.sf.jasperreports.default.pdf.encoding=Identity-H

This works perfectly fine if I put Helvetica and no enconding, and I'm positive that DejaVu Sans is in the classpath.

Will pdf.font.name accept then, any ttf in the classpath or just the standard 14 PDF fonts?

Answer

Frank picture Frank · Apr 25, 2012

"DejaVu Sans" is accepted because it is the sample Jasper font extension, which wraps an .ttf in a .jar file. You can set any font you want if you provide the corresponding font extension.

Font Extension sample doc: http://jasperreports.sourceforge.net/sample.reference/fonts/index.html