font problem during migration from jdk1.4 to jdk1.6

Recently i have encountered a problem on display font in jdk 1.4 and jdk 1.6 under RedHat environment

Some of font cannot be displayed in jdk 1.6 environment. after reading those thread here , i have resolved the problem in the following steps

1) tar the folder of  /usr/share/fonts/msttcorefonts in old machine using jdk 1.4
2) untar the files  in new machine using jdk 1.6 's folder /opt/ibm-java-x86_64-60/jre/lib/fonts
3) execute the following command as root under /opt/ibm-java-x86_64-60/jre/lib/fonts in new machine jdk1.6
sudo mkfontscale
sudo mkfontdir
sudo fc-cache -f -v

after doing above steps , some font become visble but some font still invisible( it can be visible after extending text box height but it does not suggested to do so . since over 1000 jrxml is need to revamp)

here is the font i use for your references

<reportFont name="Arial_7" isDefault="false" fontName="Arial" size="7" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="/mnt/san/COMMON/res/mingliu.ttc,1" pdfEncoding="Identity-H" isPdfEmbedded="true"/>

here is the text box jrxml for your references

<reportFont name="Arial_7" isDefault="false" fontName="Arial" size="7" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="/mnt/san/COMMON/res/mingliu.ttc,1" pdfEncoding="Identity-H" isPdfEmbedded="true"/>

does anyone has encounter the similar problem? if the problem is realted to jre , OS or jasper report library?

Can any one give some idea on resolving this problem

zol777's picture
1354
Joined: Sep 1 2006 - 1:38pm
Last seen: 7 years 8 months ago

1 Answer:

in both jdk 1.4 and jdk 1.6 , the following jrxml can be displayed in a proper manner

    <textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
     <reportElement
      x="60"
      y="185"
      width="190"
      height="10"
      key="DISPLAY_SEQ_H"
      positionType="FixRelativeToBottom"/>
     <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="3" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
     <textElement textAlignment="Right" verticalAlignment="Middle">
      <font reportFont="Arial_7" size="8"/>
     </textElement>
    <textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
    </textField>

the following jrxml is shown in a proper manner in jdk1.4 but not jdk 1.6

 <textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
     <reportElement
      x="60"
      y="195"
      width="190"
      height="8"
      key="DISPLAY_SEQ_H-1"/>
     <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
     <textElement textAlignment="Right" verticalAlignment="Middle">
      <font reportFont="Arial_7"  size="8"/>
     </textElement>
    <textFieldExpression   class="java.lang.String"><![CDATA["XXX:"+$P{REF_NBR}]]></textFieldExpression>
    </textField>

the most obivous difference is the height label only . if i wanna synchronize the behaviour of jasper report. anyone have any idea ?

zol777's picture
1354
Joined: Sep 1 2006 - 1:38pm
Last seen: 7 years 8 months ago
Feedback
randomness