guoguo2002 Posted January 30, 2008 Share Posted January 30, 2008 Hello. I think I am having a line spacing-related problem. Previously I experienced the problem that some text fields are shown in Windows but not in Linux. I have configured jre/lib/font.properties, mapping "sansserif" to Lucida Sans in both Linux and Windows. I thought this could solve the problem. However, as I am working with it further, I found that with sansserif 10 point appears in a 12 pixel height text field on Linux server, whereas it does not in Windows. In Windows, the minimum possible field height would 13 pixel. This is basically what happened and all the facts I have got. Following is a little experiment I have done try to detect the possible reason for this, and I am not sure it is correct. I just hope that more information could help anybody to help me. After a little study, I am pretty sure that the font itself has identical size in both Linux and Windows. But rather it is the space under the font. As in a report, I typed in a series of lines of numbers, and found that the numbers are in same size but the space between lines is different in Linux and Windows. I also have attached the .jrxml file that I used in the experiment above. I am looking forward any help, clue or any thing related to this. Thank you in advance!! [file name=__________________.jrxml size=3172]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/__________________.jrxml[/file] Link to comment Share on other sites More sharing options...
guoguo2002 Posted February 4, 2008 Author Share Posted February 4, 2008 Is there anyone who has any clue about this please? I really do not what to do. Best regards Link to comment Share on other sites More sharing options...
lucianc Posted February 6, 2008 Share Posted February 6, 2008 Could you confirm whether the same physical font (ttf file) is used in both Linux and Windows? If this turns out to be so, then the only explanation is that the AWT font rendering algorithms differ from Linux to Windows. Note JasperReports does not implement such algorithms, but it merely uses the text rendering features provided by AWT. For your reference, I've tried running a report with a 10 point Lucida Sans text in a 12 pixel high text element and the text didn't appear with Sun 1.6.0_03 64-bit Java on Linux (using the Lucida Sans font included in the JRE). Regards,Lucian Link to comment Share on other sites More sharing options...
guoguo2002 Posted February 6, 2008 Author Share Posted February 6, 2008 Thank you very much, Lucianc. By the way, I am sorry that I did not mension I am using Red Hat Enterprise Linux 4.5. >> Could you confirm whether the same physical font (ttf file) is used in both Linux and Windows? Yes, I think so. Because I have mapped sansserif to Lucian Sans in both OS. This physical font is shipped with JRE/JDK, so I think they are identical. I think maybe I need to check out the text rendering algorithms. I will go to Sun and RH community to ask about this question, and post it back here is I have any replies. And finally, if it is not too much trouble, can you please check it to see if it shows on RHEL?Post edited by: guoguo2002, at: 2008/02/06 00:49 Link to comment Share on other sites More sharing options...
lucianc Posted February 8, 2008 Share Posted February 8, 2008 guoguo2002 wrote:And finally, if it is not too much trouble, can you please check it to see if it shows on RHEL? I'm afraid I don't have such a system available, so (at least for the moment) I'll not be able to do this test. Regards,Lucian Link to comment Share on other sites More sharing options...
guoguo2002 Posted February 10, 2008 Author Share Posted February 10, 2008 OK, I see. Thank you very much. Could you please tell me what Linux did you use? Link to comment Share on other sites More sharing options...
lucianc Posted February 14, 2008 Share Posted February 14, 2008 guoguo2002 wrote:Could you please tell me what Linux did you use? I used Ubuntu 7.10 64bit with Sun 1.6.0_03 JDK. Regards,LucianPost edited by: lucianc, at: 2008/02/14 09:28 Link to comment Share on other sites More sharing options...
guoguo2002 Posted February 14, 2008 Author Share Posted February 14, 2008 Thank you very much, lucianc.You have been a great help. Thank you. Link to comment Share on other sites More sharing options...
venky01 Posted February 20, 2008 Share Posted February 20, 2008 Hi Lucian, I am having the same problem and I tested a report on both the OS (Linux and Windows), approximately two lines of space difference I found in a page. Please help me. Thanks,Venkat. Link to comment Share on other sites More sharing options...
wangyi Posted February 26, 2008 Share Posted February 26, 2008 Guoguo, I have the same spacing issue. I would like to troubleshooting the cause. Could you please let me know where I can find ttf file in Jdk? I am using jrocki jvm, and I only find fontconfig.bfc, alike files, not font.properties. In local dev, we are using jdk5, and prod is weblogic with Jrokie. Do you think we need to use Jrocki to compire jasper file? Thanks Yi Link to comment Share on other sites More sharing options...
wangyi Posted February 26, 2008 Share Posted February 26, 2008 lucianc, I have the same line spacing issue between WIN and Linux. I compare all ttf files and they are identical in JDK5 and Jrokit. Could you please give me some hints regarding different troubleshooting? Thanks very much. Link to comment Share on other sites More sharing options...
guoguo2002 Posted February 26, 2008 Author Share Posted February 26, 2008 Hi, Wangyi. Thank you for takeing care of the problem. Can you please share your findings with us as you go? That would be very beneficial to us. And also, if there is any thing I can do, please tell me. I will try my best in assisting you. For your questions, here are the answers. I am using Sun JDK. My ttf files are located in JAVAHOMEjrelibfont with jdk1.6 update 3. fontconfig.properties is in JAVAHOMEjrelib. where JAVAHOME represents the folder of jdk installation folder. Please note that different fontconfig files are loaded according to OS. The above file applies in Windows XP Professional. I will give you the property file name for RHEL4.5. I will try to find jrocki jvm in the weekend. And yes, I think it is better to use the same jvm to compile the .jrxml file and run the .jasper file. Post edited by: guoguo2002, at: 2008/02/26 14:35Post edited by: guoguo2002, at: 2008/02/26 23:16 Link to comment Share on other sites More sharing options...
guoguo2002 Posted April 10, 2008 Author Share Posted April 10, 2008 hello, dear friend. How is the trouble-shooting going? Link to comment Share on other sites More sharing options...
taborda Posted July 3, 2008 Share Posted July 3, 2008 i'm having the same problem.... some titles in my reports get truncated, some report return more pages in linux than in windows...and some line spaces are bigger... does any one already found the reason for this to happen? and how to fix it? best regards, João TabordaPost edited by: taborda, at: 2008/07/03 14:31 Link to comment Share on other sites More sharing options...
taborda Posted July 7, 2008 Share Posted July 7, 2008 ok, we did it ;) in the end i don't really know what was the correct step to make the reports equal in windows and linux, first we installed windows true type fonts on linux (verdana, arial, times new roman..etc..) i don't remember which rpm we installed, but it was a simple google search... only this didn't help, so (after installing 3 different packages of "windows fonts") we also discovered there were some fonts on our java instalation directory, probably java was using these by default, after erasing them reports were OK and looked like windows generated ones ;) thanks for all the hints here in the forum :)João Taborda Link to comment Share on other sites More sharing options...
alan123qwe Posted July 21, 2008 Share Posted July 21, 2008 I'm having the same problem and i tried change the "net.sf.jasperreports.export.pdf.force.linebreak.policy" attribute to true, but it didn't work.I tried change the fonts and nothing.I can't change my linux version, because my clients won't accept it. I can change the java version.Can anyone tell me if theres any other solution that works? Java 6 solves it? thank you Link to comment Share on other sites More sharing options...
alan123qwe Posted July 25, 2008 Share Posted July 25, 2008 Please help. Link to comment Share on other sites More sharing options...
chamaster Posted September 3, 2008 Share Posted September 3, 2008 Hi João,Your solution worked for us as well.Thanks !Anthony 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