How to set the fonts in fop-0.91beta

Here should go questions about transforming XML with XSLT and FOP.
JANA
Posts: 8
Joined: Wed Jan 18, 2006 9:53 am

How to set the fonts in fop-0.91beta

Post by JANA »

Hi Iam using \fop-0.91beta version...

I have set the fonts like this in conf/fop.xconf

<fonts>

<!-- example -->
<font metrics-url="C:\arial.xml" embed-url="C:\arial.ttf" kerning="yes">
<font-triplet name="Arial" style="normal" weight="normal"/>
<font-triplet name="ArialMT" style="normal" weight="normal"/>
</font>
<font metrics-url="D:\fop\fop-0.91beta-bin-jdk1.4\fop-0.91beta\arialbd.xml" embed-url="D:\fop\fop-0.91beta-bin-jdk1.4\fop-0.91beta\arialbd.ttf" kerning="yes" >
<font-triplet name="Arial" style="normal" weight="bold"/>
<font-triplet name="ArialMT" style="normal" weight="bold"/>
</font>
<font metrics-url="D:\fop\fop-0.91beta-bin-jdk1.4\fop-0.91beta\ariali.xml"
embed-url="D:\fop\fop-0.91beta-bin-jdk1.4\fop-0.91beta\ariali.ttf" kerning="yes" >
<font-triplet name="Arial" style="italic" weight="normal"/>
<font-triplet name="ArialMT" style="italic" weight="normal"/>
</font>
<font metrics-url="D:\fop\fop-0.91beta-bin-jdk1.4\fop-0.91beta\arialbi.xml" embed-url="D:\fop\fop-0.91beta-bin-jdk1.4\fop-0.91beta\arialbi.ttf" kerning="yes">
<font-triplet name="Arial" style="italic" weight="bold"/>
<font-triplet name="ArialMT" style="italic" weight="bold"/>
</font>
<!-- Example Japanese fonts
<font metrics-url="msgothic.xml" embed-url="D:\winnt\font\msgothic.ttc" kerning="yes">
<font-triplet name="Gothic" style="normal" weight="normal"/>
<font-triplet name="Gothic" style="normal" weight="bold"/>
<font-triplet name="Gothic" style="italic" weight="normal"/>
<font-triplet name="Gothic" style="italic" weight="bold"/>
</font>
<font metrics-url="msmincho.xml" embed-url="Cyberbit.ttf" kerning="yes">
<font-triplet name="Mincho" style="normal" weight="normal"/>
<font-triplet name="Mincho" style="normal" weight="bold"/>
<font-triplet name="Mincho" style="italic" weight="normal"/>
<font-triplet name="Mincho" style="italic" weight="bold"/>
</font>

but when i run the fop it will shows following error....

Font 'Arial,normal,400' not found. Substituting with default font.
Font 'Arial,normal,700' not found. Substituting with default font.

Please i need the solution as soon as possible..

bye
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,

You have to use the values Arial, ArialMT, Gothic, etc. for the font-family attribute and the appropriate values for the font-weight and font-style attributes (bold, normal, italic) in the fo:block blocks containing the text that you want to render with the fonts configured in fop.xconf. You did not say anything about the source FO document so I cannot guess anything about it.

Regards,
Sorin
Post Reply