Jump to content

JasperReport fonts


samshell

Recommended Posts

Hi everyone!
I'm newbie in JasperReports.
I have a report that must be generated on IBM zOS (MainFrame) and
then I need to export it to .docx format, then users download it and print
in Windows. I'm using SansSerif font in report (because I have very limited number
of fonts on mainframe), everything works fine, but when I open .docx on windows,
SansSerif tranformed into Times New Roman, on windows I don't have SansSerif,
only MS SansSerif. It's not a problem for me,  because I can add this font to JRE on windows,
or use another font, but why is this happen ?
 

Link to comment
Share on other sites

  • 11 months later...
  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...

I think what I saw so far is

 

If you are generating RTF report and set the font as SansSerif the output is actually something which is Serif and not "Sans" the reason is if I generate same report in DOCX i get TimesNewRoman. And this font is actually from the family of SansSerif (without strokes @ the end of each character)

 

Also There is no such a font called SansSerif in Windows but you have Microsoft SansSerif, MS Reference SansSerif etc.

 

so

1) Im not sure why the same reports with different output generated with different font

2) What if Im generating a report using Jasper on Unix box where I may not have Microsoft Sans Serif ..but If I set the property in JRXML as Microsot SansSerif..what would be the actual output font?

Somewhere Im preety much confused.

Link to comment
Share on other sites

Here can be found more info about JR fonts and font extensions.

SansSerif is a logical font name, so it needs to be translated into real TTF font names during the report export. That depends on how each document viewer application choose to set the appropriate font for the corresponding logical font name.

In order to make sure the font remains the same for each output format, you have to export the desired fonts as font extension, and put them in the app's classpath.

HTH,

sanda

Link to comment
Share on other sites

  • 3 weeks later...
  • 4 years later...

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...