markrgli Posted September 30, 2009 Share Posted September 30, 2009 Hello everyone, We are using JasperReports (3.1.4) on a Tomcat server (6.0.20) running on a Linux machine (Debian Lenny - Linux jp1 2.6.26-2-686 #1 SMP Sun Jun 21 04:57:38 UTC 2009 i686 GNU/Linux) and we're having problems generating reports that use TTF fonts (mostly Arial variants like Arial Narrow in bold). Text using this font are truncated, i.e. "Work Schedule Information" becomes "Work Schedule Informa." Our font files are inside the lib directory of Tomcat and they are referenced in our JRXML templates as in the example below. This problem only happens when the reports are generated from the Linux machine. We have the same Tomcat configuration (including the location of fonts) running on Windows XP and report generation works fine. Right now we are clueless as to what's happening so I hope you guys can shed some light on this one.Thank you very much. Regards,Mark Code: Post Edited by markrgli at 09/30/2009 07:44 Link to comment Share on other sites More sharing options...
Teodor Danciu Posted September 30, 2009 Share Posted September 30, 2009 Hi, Having the TTF files in the classpath is not enough.They have to actually be available in the system or be registered with the JVM. You can do this by wrapping up these TTF files in a font extension JAR. By doing this, the JR will register them with the JVM and thus the JVM will no longer use some replacement font, that would cause the font metrics mismatch that you experience. Also, if you use font extensions, you no longer need to deal with the pdfXXX attributes in your JRXML, as these settings are specified in the font extension config tile. Take a look at the /demo/fonts folder in the JR project to see what a font extension is made of. You can ZIP up such folder in a JAR and add it to your application classpath. I hope this helps.Teodor Link to comment Share on other sites More sharing options...
markrgli Posted September 30, 2009 Author Share Posted September 30, 2009 Thank you very much for the prompt response, teodord. We will try what you suggested and shall update this thread. Link to comment Share on other sites More sharing options...
markrgli Posted October 5, 2009 Author Share Posted October 5, 2009 To close this one, we've deployed our application with the font extensions as advised by teodord and it looks like it's working smoothly now. Thanks, teodord.Post Edited by markrgli at 10/05/2009 07:30 Link to comment Share on other sites More sharing options...
jonifitoarg Posted March 7, 2011 Share Posted March 7, 2011 Hello allI created a report with iReport3.0.0 and I used some ttf fonts; when I run de report in IReport I have no problems but when I run it from and aplication running in tomcat 6 don't show me the fonts that I used in the report. Please Help me! Thanks Link to comment Share on other sites More sharing options...
ernestoo Posted March 7, 2011 Share Posted March 7, 2011 http://mdahlman.wordpress.com/2010/05/28/jaspersoft-v3-7-font-extensions/ Link to comment Share on other sites More sharing options...
jonifitoarg Posted March 8, 2011 Share Posted March 8, 2011 Thanks so much! 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