mreis Posted July 14, 2011 Share Posted July 14, 2011 Our reports contain text elements defining a font using <font fontName="Arial" size="12" isBold="false" isItalic="false" pdfFontName="Helvetica-Bold" isPdfEmbedded="false"/> We defined the pdfFontName attribute for every <font> tag (using either Helvetica or Helvetica-Bold as the value).Due to the fact that our JVM (IBM V9) doesn't define a mapping for Arial, I get the following warning: "Font 'Arial' is not available to the JVM." Nevertheless the pdf report is successfully rendered - the fonts that this pdf contains are Helvetica and Helvetica-Bold (as expected).Then I created a fonts-extension jar including some metadata and the arial*.ttf font files. Now JasperReports finds Arial and doesn't bring out the warning .So far everything works as expected. The resulting PDF however now contains the following fonts: ArialMT and Helvetica.My question is why (in the second case with the fonts-extension.jar) the resulting PDF doesn't contain Helvetica and Helvetica-Bold as its fonts (but instead ArialMT and Helvetica)? I'd like to find a way to eliminate the warning, and also get a PDF that contains Helvetica and Helvetica-Bold.kind regards & many thanks,markus Link to comment Share on other sites More sharing options...
mdahlman Posted July 20, 2011 Share Posted July 20, 2011 You may need to un-define "pdfFontName" everywhere in your report. Just use the font(s) that you have defined in the font extension jar file as the Font for your text fields.Regards,Matt Link to comment Share on other sites More sharing options...
mreis Posted July 22, 2011 Author Share Posted July 22, 2011 Matt - after quite some research - I fully agree with you that we should avoid using the pdfFontName property for every <font> definition (using a different font for the fontName and pdfFontName property seems completely wrong).On the one hand pdfFontName is a deprecated property and should thus be avoided, on the other hand a fontName (with corresponding fonts in the jasper font extension jar) overrides the pdfFontName anyway. using a font extension jar should further eliminate all my cross-platform problems.one last negative aspect is that I couldn't eliminate the Helvetica font from the pdf - this topic can be found here: http://jasperforge.org/plugins/espforum/view.php?group_id=102&forumid=103&topicid=74379&topid=89864I think I should file a bug for this ... regards,markus Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now