0

I am using Jaspersoft Studio and am attempting to do what should be one of the simplest tasks, resize a static text element. However no matter what means I think of to try and change the text size it stays the default size.

Here is the .jrxml code I am using for one such static text element

<staticText>
            <reportElement mode="Opaque" x="0" y="0" width="700" height="40" forecolor="#00B050" uuid="52a12b2e-4819-44b4-8d51-047fd668e28c">
                <property name="local_mesure_unitx" value="pixel"/>
                <property name="com.jaspersoft.studio.unit.x" value="px"/>
                <property name="local_mesure_unity" value="pixel"/>
                <property name="com.jaspersoft.studio.unit.y" value="px"/>
                <property name="local_mesure_unitwidth" value="pixel"/>
                <property name="com.jaspersoft.studio.unit.width" value="px"/>
                <property name="local_mesure_unitheight" value="pixel"/>
                <property name="com.jaspersoft.studio.unit.height" value="px"/>
            </reportElement>
            <textElement textAlignment="Left">
                <font size="18" isBold="true"/>
            </textElement>
            <text><![CDATA[Supportive Services]]></text>
        </staticText>

Attached is also an image of where I've set the font size using the editor. enter image description here

After making these changes the text is still the default size. Here is an image of the resulting report... enter image description here

Does anyone know why this is happening? Is there some sort of global text setting in Jaspersoft Studio or JasperReports in general that I am forgetting?

Alex K
  • 22,315
  • 19
  • 108
  • 236
OrwellHindenberg
  • 4,988
  • 8
  • 38
  • 58
  • I have determined that this problem exists exclusively in .pdf and most likely will be solved by using pdfFontName and/or pdfEncoding tags – OrwellHindenberg Aug 12 '14 at 14:34

1 Answers1

1

You would need to create a font extension for the fonts you want to use. The reason behind this is that JVM does not get the fonts you want to use at runtime, hence it takes the fonts it has with it (Arial in most cases).

Darshan Lila
  • 5,772
  • 2
  • 24
  • 34
  • Good idea, but I don't think this is the case. I had been using Sans Serif, but when I changed it to another font type I got the following error: Class net.sf.jasperreports.engine.util.JRFontNotFoundException Message Font 'DejaVu Serif' is not available to the JVM. See the Javadoc for more details. So I believe that I only see this error because DeJaVu is one of the font types I would need to create an extension for. – OrwellHindenberg Aug 01 '14 at 15:32
  • True. If Sans Serif is available in JVM there will not be any problem. But when the fonts are not available,that's where you will face the problem. – Darshan Lila Aug 02 '14 at 05:12