[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.birt] Re: PDF Fonts

The following answer apply to the BIRT example viewer.

There are three things needed to be done.
1. locating the FOP configuration file for BIRT (fop.xml)
2. put the font information in the fop.xml
3. create the font matrix file that is need by FOP


1. locating the FOP configuration file for BIRT (fop.xml)

The FOP will read the FOP configuration files in several locations. One of which can be specified by using the FOP_CONFIG_FILE system property.

So add this to the JVM that is running your BIRT.
-DFOP_CONFIG_FILE=<path to your FOP config files>


2. put the font information in the fop.xml

In the fop.xml (the config file)
add something similary to the following

-------------------

<fonts>
<font metrics-file="<url to font matrix>" embed-file="<url to the .ttc file>" kerning="yes">
<font-triplet name="ms mincho" style="normal" weight="normal"/>
<font-triplet name="ms mincho" style="normal" weight="bold"/>
<font-triplet name="ms mincho" style="italic" weight="normal"/>
<font-triplet name="ms mincho" style="italic" weight="bold"/>


</font>

Note the path is URL so it might have to start with things like "file:///C:"

Also the "name" in <font-triplet> of the font have to be exact string that is use by BIRT.
For example if you are uing a non English windows with the font name in other language, then the name in the xml have to be that non english name. So the font "ms mincho" above can have a name of "ïï ææ" if the font use by BIRT use the Japanese name of the font instead of the English name of the font.


(I just created two entry, one in English and one in Japanese so everything is covered)

----------------------------

3. create the font matrix file that is need by FOP

It is best to refer to the FOP web site. You will need to download the standalone FOP to get the JAR file that will create the font matrix for you in the instruction from the web site.

Here is the link
http://xml.apache.org/fop/fonts.html#truetype-metrics

Hope that helps

Gerald Chan

Joe Rybacki wrote:
I figured out that fop is what's used for pdf generation and I was able to generate the metric file for the font. But I can't quite figure out how to integrate it with birt. The fonts directory is part of the fop configuration so I guess I'll have to start digging into the source for birt and fop to figure out how birt is invoking fop. Has anyone figured this out?


"Joe Rybacki" <Joe.Rybacki@xxxxxxxxxxxx> wrote in message news:d84m90$huf$1@xxxxxxxxxxxxxxxxxxx


Hello all, I have a question regarding fonts. I have a true type font that I want to embed into the PDF so that it is rendered correctly in the pdf. It works fine as html b/c the font is installed in the windows system. Does birt do the embedding or am I missing some configuration parameter?

Thanks,
Joe