PDF font size not respected on Jasper Reports

3,626 views
Skip to first unread message

Antoni Ten Monrós

unread,
May 26, 2015, 5:00:50 AM5/26/15
to idem...@googlegroups.com
I'm trying to replicate some reports done for ADempiere into iDempiere, and while in ADempiere (swing client) I had no issues with the system respecting my font settings (I mainly used either logical fonts [Sans-serif, Serif, etc] or the standard 14 fonts for PDFs), I find that in iDempiere, font size is ignored and all fonts appear to have the same size (10pt). As file size is quite important for my use case, I would prefer not having to embed fonts (that's the point of using the standard 14 PDF fonts).

Antoni Ten Monrós

unread,
May 26, 2015, 5:02:14 AM5/26/15
to idem...@googlegroups.com
On Tuesday, May 26, 2015 at 11:00:50 AM UTC+2, Antoni Ten Monrós wrote:
I'm trying to replicate some reports done for ADempiere into iDempiere, and while in ADempiere (swing client) I had no issues with the system respecting my font settings (I mainly used either logical fonts [Sans-serif, Serif, etc] or the standard 14 fonts for PDFs), I find that in iDempiere, font size is ignored and all fonts appear to have the same size (10pt). As file size is quite important for my use case, I would prefer not having to embed fonts (that's the point of using the standard 14 PDF fonts).

By the way, everything looks perfect on Jasper Studio, but the problem appears when generating the jasper report through iDempiere.

Carlos Antonio Ruiz Gomez

unread,
May 26, 2015, 9:12:12 AM5/26/15
to idem...@googlegroups.com
Hi Antoni, it sounds like a font issue, it is common when you develop jasper in a windows machine, and then deploy it on a linux machine to have issues with fonts not installed.  All the jasper rendering in zk is done in the server.

Regards,

Carlos Ruiz
--

Antoni Ten Monrós

unread,
May 26, 2015, 9:37:53 AM5/26/15
to idem...@googlegroups.com
On Tuesday, May 26, 2015 at 3:12:12 PM UTC+2, Carlos Antonio Ruiz Gómez wrote:
Hi Antoni, it sounds like a font issue, it is common when you develop jasper in a windows machine, and then deploy it on a linux machine to have issues with fonts not installed.  All the jasper rendering in zk is done in the server.

Regards,

Carlos Ruiz

I'm developing jasper on a virtual machine that houses both Jasper Studio and a test server. It's a linux machine. It has the required fonts installed, and I was going for the standard 14 PDF fonts anyway, in order to avoid needing to embed the font on the report. I really do not mind if it's viewed with Arial, Helvetica or Freesans, but I need it to be 16pt for the title, and 7 point for the table header, and it's using 10-point font sizes for both.

I'll keep experimenting though.


 

Carlos Antonio Ruiz Gomez

unread,
May 26, 2015, 9:59:24 AM5/26/15
to idem...@googlegroups.com
Also, you can try iReport 5.6.0 instead of Jasper Studio.

Antoni Ten Monrós

unread,
May 26, 2015, 10:36:36 AM5/26/15
to idem...@googlegroups.com
On Tuesday, May 26, 2015 at 3:59:24 PM UTC+2, Carlos Antonio Ruiz Gómez wrote:
Also, you can try iReport 5.6.0 instead of Jasper Studio.

I also tried, and I'm having the same issue. Font face is correctly recognized, font size is not. Yeah, I'm real puzzled.

Antoni Ten Monrós

unread,
May 26, 2015, 10:55:43 AM5/26/15
to idem...@googlegroups.com

Ok, I was wrong, font face is not correctly recognized, it's just that I had lucked out when I swapped to DejaVu Sans Mono and it was the default sans mono font.

I'm launching iDempiere from Eclipse, that shouldn't matter, but I'll state it in case it helps shed some light on the issue

Freddy Heredia

unread,
May 26, 2015, 11:07:54 AM5/26/15
to idem...@googlegroups.com
Hello Antoni, you can try the following in the fields you want to format:
Markup = styled
Text Field Expression = "<style size = '20 '>" + "yourfield or Text" + "</ style>"

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/778aa802-dd76-4317-8f95-26f7ff9c1225%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Antoni Ten Monrós

unread,
May 27, 2015, 9:33:35 AM5/27/15
to idem...@googlegroups.com, freddy....@ingeint.ec
On Tuesday, May 26, 2015 at 5:07:54 PM UTC+2, Freddy Heredia wrote:
Hello Antoni, you can try the following in the fields you want to format:
Markup = styled
Text Field Expression = "<style size = '20 '>" + "yourfield or Text" + "</ style>"

Thanks, that worked. The problem is, Jasper is not respecting right or left align either, and AFAIK, that can't be fixed with markup...

Antoni Ten Monrós

unread,
May 27, 2015, 10:09:33 AM5/27/15
to idem...@googlegroups.com, freddy....@ingeint.ec

Compiling the report with the last verion of iReport works, so there's probably a bug with Jasper Studio

Fco. Javier Vannini Robelo

unread,
May 27, 2015, 11:02:45 AM5/27/15
to idem...@googlegroups.com
Have you looked into True Type Fonts ? http://community.jaspersoft.com/wiki/ireport-fonts

I was having the problem that the font when transformed to a PDF was NOT the same font I was using on my i-Report. To fix this I installed a TTF. I wonder if the issue you are having with the font sizes is the fixed by same way.



--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.

Antoni Ten Monrós

unread,
May 27, 2015, 11:18:10 AM5/27/15
to idem...@googlegroups.com

On Wednesday, May 27, 2015 at 5:02:45 PM UTC+2, FJVR wrote:
Have you looked into True Type Fonts ? http://community.jaspersoft.com/wiki/ireport-fonts

I was having the problem that the font when transformed to a PDF was NOT the same font I was using on my i-Report. To fix this I installed a TTF. I wonder if the issue you are having with the font sizes is the fixed by same way.

The problem was not that the used font on iReport did not match the font used by iDempiere when outputting the PDF, (in fact, that's probably even expected, given that I was using logical font families - Sans Serif, etc, as I don't want to embed the font on the PDF, to get smaller file sizes). The problem was that the attributes specified for the font on Jasper Studio (font size, alignement, etc) did not get applied correctly when the report was output by iDempiere.

It seems that the problem was that Jasper Studio didn't produce compatible jasper files, even when instructed to output Jasper Reports 5.6 files via the compatibility options.

Alejandro Guerra

unread,
May 27, 2015, 12:36:51 PM5/27/15
to idem...@googlegroups.com
so what is better to use jasper studio or ireport and which version??

Antoni Ten Monrós

unread,
May 28, 2015, 2:35:25 AM5/28/15
to idem...@googlegroups.com
On Wednesday, May 27, 2015 at 6:36:51 PM UTC+2, Alejandro Guerra wrote:
so what is better to use jasper studio or ireport and which version??

My personal experience was that iReport 5.6 worked better. However, there's no problem if you simply make your reports with Jasper Studio, and then open the jrxml file with iReport and compile it.
Reply all
Reply to author
Forward
0 new messages