Font Mapping for PDF Format
Physical fonts need to be installed in locations known to Java Runtime Environment.
Users can add the physical fonts that use a supported font technology by installing them either in the jre/lib/fonts directory within the J2RE, or by installing them in a way supported by the host operating system (copying them into the Fonts folder of windows, using the pkgadd command in solaris, etc).
After you have installed the Windows true type font and !PostScript type 1 fonts onto your JVM, you will have to do the font mapping in Elixir Report to load the right fonts for report generation.
When you start the Report the Font types will be loaded along with it. In the config folder of $PRODUCT_HOME there is a “EREngine-config.xml” file which controls font mapping. The
Java system property “elixirtech.fonts.path” is assigned the value of the absolute path of the font directory.
Java AWT font types on Window platform.
Java Font AWT | font.properties-mapped in JDK 1.4 | PDF Type1 Font Family mapped |
---|---|---|
Dialog | Arial | Helvetica Type1 - Actual font : Arial MT, true type |
DialogInput | Courier | Courier Type 1 - Actual font : Courier, Type 1 |
Monospaced | Courier | Courier Type 1 - Actual font : Courier, Type 1 |
SansSerif | Arial | Helvetica Type1 - Actual font : Arial MT, true type |
Serif | Times New Roman | Times Type 1 - Actual font : TimeNewRomanPSMT, truetype |
Type1 PDF fonts with encoding Cp1252
Window Font Face Name PDF Type1 Font Name | PDF Type1 Font Name |
---|---|
Courier New | Courier |
Courier New Bold | Courier-Bold |
Courier New Italic | Courier-Oblique |
Courier New Bold Italic | Courier-BoldOblique |
Times New Roman | Times-Roman |
Times New Roman Bold | Times-Bold |
Times New Roman Italic | Times-Italic |
Times New Roman Bold Italic | Times-BoldItalic |
List of PDF Type 1 font names
PDF Type 1 Font Name (14)
- Courier
- Courier-Bold
- Courier-Oblique
- Courier-BoldOblique
- Times-Roman
- Times-Bold
- Times-Italic
- Times-BoldItalic
- Helvetica
- Helvetica-Bold
- Helvetica-Oblique
- Helvetica-BoldOblique
- Symbol
- ZapfDingbats
List of possible encodings
- Identity-H
- Identity-V
- Cp1250
- Cp1252
- Cp1257
- MacRoman
Note
Many fonts are released under a license that prevents embedding. You must ensure that you are allowed to embed the fonts you use.
CJK Font Mapping
=Supported from version 6.1 onward=
The PDF specification defines 14 built-in fonts.
If you use fonts that are not part of the specification they can be embedded in the report (subject to font licensing)
or the glyphs can be rendered as vectors, removing the need for the font, but making selection impossible.
CJK Fonts can be very large, so embedding the glyphs or even the font itself results in large files
CJK Mapping File
It is a text file, which contains a substitution on each line. For example:%BR%
Serif=STSong-Light%BR%
!SansSerif=MSung-Light
You can create this mapping file as a text file in the repository, so that many reports can share it and
so you can easily deploy it to the Repertoire Server if necessary. Once the mapping file is chosen, all
text in the report that use Serif font will be written to PDF as STSong-Light.
Common CJK font encodings
These are defined in
- STSong-Light: encoding=UniGB-UCS2-H
- MHei-Medium: encoding="UniCNS-UCS2-H
- MSung-Light: encoding="UniCNS-UCS2-H
- HeiseiKakuGo-W5: encoding="UniJIS-UCS2-H
- HeiseiMin-W3: encoding="UniJIS-UCS2-H
- HYGoThic-Medium: encoding="UniKS-UCS2-H
- HYSMyeongJo-Medium: encoding="UniKS-UCS2-H
Note
After any modification to EREngine-config.xml, please remember to restart the application.
For fonts with other languages, please save this file in the corresponding encoding.
E.g.for Chinese font that can only be shown in ‘UTF-8’ encoding, the file has to be saved in encoding ‘UTF-8’.