Cannot load font: failed to create Source from metrics file
Posted: Tue Jul 24, 2007 12:03 am
Hello FOP Users,
I am new to using FOP and have been encountering this problem, hopefully some of you gurus out there can shed some light.
Currently I am using FOP 0.93, attempting to use the Arial font on some of my fo:blocks.
I followed the instructions on the Apache FOP site on how to set up the configuration file, and here's a snippet within my pdf renderer. Note that both the metrics file and the ttf file are in the same directory as the config file:
<font metrics-url="arial.ttf.xml" kerning="yes" embed-url="ARIAL.TTF">
<font-triplet name="Arial" style="normal" weight="normal"/>
<font-triplet name="ArialMT" style="normal" weight="normal"/>
</font>
<font metrics-url="ARIALUNI.TTF.xml" kerning="yes" embed-url="ARIALUNI.TTF">
<font-triplet name="Arial" style="normal" weight="normal"/>
<font-triplet name="ArialMT" style="normal" weight="normal"/>
</font>
I get the following error when I attempt to render a pdf:
org.xml.sax.SAXException: Cannot load font: failed to create Source from metrics file ARIALUNI.TTF.xml
I generated my metrics file with the following command:
java -cp fop-0.93.jar;avalon-framework-api-4.3.jar;commons-logging-1.0.4.jar;commons-io-1.2.jar org.apache.fop.fonts.apps.TTFReader -fn Arial ArialUni.ttf ArialUni.ttf.xml
Any help is greatly appreciated.
-Betty
I am new to using FOP and have been encountering this problem, hopefully some of you gurus out there can shed some light.
Currently I am using FOP 0.93, attempting to use the Arial font on some of my fo:blocks.
I followed the instructions on the Apache FOP site on how to set up the configuration file, and here's a snippet within my pdf renderer. Note that both the metrics file and the ttf file are in the same directory as the config file:
<font metrics-url="arial.ttf.xml" kerning="yes" embed-url="ARIAL.TTF">
<font-triplet name="Arial" style="normal" weight="normal"/>
<font-triplet name="ArialMT" style="normal" weight="normal"/>
</font>
<font metrics-url="ARIALUNI.TTF.xml" kerning="yes" embed-url="ARIALUNI.TTF">
<font-triplet name="Arial" style="normal" weight="normal"/>
<font-triplet name="ArialMT" style="normal" weight="normal"/>
</font>
I get the following error when I attempt to render a pdf:
org.xml.sax.SAXException: Cannot load font: failed to create Source from metrics file ARIALUNI.TTF.xml
I generated my metrics file with the following command:
java -cp fop-0.93.jar;avalon-framework-api-4.3.jar;commons-logging-1.0.4.jar;commons-io-1.2.jar org.apache.fop.fonts.apps.TTFReader -fn Arial ArialUni.ttf ArialUni.ttf.xml
Any help is greatly appreciated.
-Betty