Java – JasperReports PDF font name (default in jasperreports.properties)

dynamic-jasperfontsjasper-reportsjavapdf

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?

Best Answer

"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

Related Topic