Jump to content
JasperReports Library 7.0 is now available ×

Latest version of JasperReports 6.3.0 have problem with sub/sup tag


_freeman_

Recommended Posts

Hello,

I've noticed that in new version 6.3.0 there is still strange behaviour that I've reported few years ago(http://community.jaspersoft.com/questions/542340/subscript-tag-problem).

Ok, I've continued digging the source code and I've founded that the problem occure when jrprint is drawing to the Image, but only with specific fonts. 

For example, if you use DejaVu Serif, DejaVu Sans, Times New Roman .. but everything is ok when I use font FreeSans. 

Maybe somone can confirm that this is a bug .. class is JRPrinterAWT.java, method: printPageToImage.

Jasperreport  version is 6.3.0, jrxml for testing this:

<?xml version="1.0" encoding="UTF-8"?><jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreportshttp://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="rptZahtev" pageWidth="595" pageHeight="842" columnWidth="538" leftMargin="20" rightMargin="37" topMargin="21" bottomMargin="10" uuid="bd88b67f-8665-4395-b673-cfb74d86ad0a"><property name="ireport.zoom" value="1.2100000000000124"/><property name="ireport.x" value="0"/><property name="ireport.y" value="505"/><background><band splitType="Stretch"/></background><title><band height="144" splitType="Stretch"><staticText><reportElement uuid="57c28347-e699-4c46-9dee-f54048a6f079" x="221" y="0" width="221" height="72"/><box topPadding="2" leftPadding="2"><pen lineWidth="1.5"/><topPen lineWidth="1.5"/><leftPen lineWidth="1.0"/><bottomPen lineWidth="1.5"/><rightPen lineWidth="1.0"/></box><textElement textAlignment="Center" verticalAlignment="Middle" markup="styled"><font fontName="DejaVu Serif" size="12" isUnderline="true" /></textElement><text><![CDATA[TEXT <sub>subscript</sub> TEXT]]></text></staticText><staticText><reportElement uuid="57c28347-e699-4c46-9dee-f54048a6f079" x="221" y="72" width="221" height="72"/><box topPadding="2" leftPadding="2"><pen lineWidth="1.5"/><topPen lineWidth="1.5"/><leftPen lineWidth="1.0"/><bottomPen lineWidth="1.5"/><rightPen lineWidth="1.0"/></box><textElement textAlignment="Center" verticalAlignment="Middle" markup="styled"><font fontName="FreeSerif" size="12" isUnderline="true" /></textElement><text><![CDATA[ TEXT <sub>subscript</sub> TEXT ]]></text></staticText></band></title></jasperReport>[/code]
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

Hello,

if someone else also bump on this kind of a problem I've founded workaround.

If using TEXT <sub>subscript</sub> TEXT, with Times New Roman, you will get this report:

jasperproblem_2.png.2b1161b1cedba90c39413989355ffa3e.png

Workaround for this is to use <sup> tag with <sub>, like this TEXT <sub>subscript</sub><sup> </sup>TEXT, and voila: 

jasperproblem_1.png.2673b61bbe6ea5fa28d8cbe01923d697.png

 

Hope that someone will find this halpful .. 

This is a jar with font I've used .. please change extension to TimesNewRoman.jar befor use it: 

TimesNewRoman_jar.txt

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...