Users might find that well designed reports in JReport Designer become truncated when running in JReport Server on a different platform. The reason being that various platforms use different font systems, and by mapping the fonts to a different platform by JDK, the report result is shown with a discrepancy. To solve this problem, Java provides a True Type Font (TTF) administrative system, which allows the fonts to be published together with a report into the runtime environment independent of the platform fonts.
In addition, in cases where end users do not have the fonts used in a report, JReport provides a PDF embedded fonts solution. That is, the fonts are embedded in the PDF file, and end users do not need to install the fonts to their local machines.
Notes:
The following topics describe how to use TTF in your reports.
To design reports with TTF, follow the steps below:
<install_root>\font
subdirectory. You can find the TTF fonts in your system's Font directory or from the Internet.If you want to publish report files that use True Type Fonts to other operating systems, you will need to place the relevant font files (other files in the font path) in the <install_root>\font
directory of the operating system of where you want to publish the report. Make sure that you copy or ftp (in binary mode) the .ttf files to the directory.
For files of HTML/RTF/Excel formats, they will find the fonts from the system font directory. If you want to deliver the report result in the above formats to end users, you should choose the TTF fonts that are commonly used on Windows systems for your reports. If you have to use fonts that do not exist in a client system, you can choose the embedded TTF font solution for a good print result in PDF format.
To view PDF reports with other character sets, for example, Chinese fonts, you will need to install special language packages. Also, if you design reports with fonts that are not within Acrobat's internal fonts, they will be mapped differently. The above two cases will cause trouble to end users when viewing or printing a report with Acrobat Reader. However, differing from HTML and RTF, PDF allows the embedding of the font description within a file. JReport therefore provides the embedded TTF font solution for a PDF result. You will find it extremely helpful in the following cases:
To take advantage of the PDF embedded TTF font feature, follow the steps below:
By embedding TTF fonts, the file size will increase a little. However, it is still of reasonable size to be transferred over a network.
JReport supports the Bold and Italic properties when you design report with TTF. When you select a TTF font and set the Bold/Italic property to true, JReport will first automatically search the <install_root>\font
directory to check all the TTF files related with the TTF font you have selected previously. If there is such a TTF file holding the Bold/Italic property, JReport will use the font style defined in this file to match your setting and make the Bold/Italic function take effect; if not, JReport will find the specified font in your platform fonts and apply the Bold/Italic function directly.
Moreover, when you select an embedded font while using TTF to design reports, and set the Bold/Italic property to true, if JReport find the related TTF file to match your setting, the matched font with the Bold/Italic property will be embedded when you want to export the report result to a PDF file.