I'm attempting to add a font to my userconfig.xml file. I'm using fop
version 0.20.1.
I've followed the directions at apache for adding fonts -
http://xml.apache.org/fop/fonts.html
I'm using VisualAge for Java running in the Websphere test environment on
windows 2000.
In my Java I've specified the option of the userconfig file with the API:
//Set the User Config File which includes the company font
File userConfigFile = new File("C:
\\Fop-0.20.1\\conf\\userconfig.xml"); //temp hardcode
Options options = new Options(userConfigFile);
When I don't specify a path to where my metrics and ttf file are located I
get the following error:
reading user configuration file
building formatting object tree
setting up fonts
[1Failed to read font metrics file complogoTTF.xml :
File
"file:///C:/IBMVJava353/ide/tools/com-ibm-ivj-ui-webcontrolcenter/complogoTTF.xml"
not found.
[2java.lang.RuntimeException: java.lang.NullPointerException
So I placed my metrics file and ttf file in the
"C:/IBMVJava353/ide/tools/com-ibm-ivj-ui-webcontrolcenter" folder and
everything works like it should.
Here is the userconfig.xml file I used:
<configuration>
<fonts>
<font metrics-file="complogoTTF.xml" kerning="yes" embed-file="
complogo.ttf">
<font-triplet name="Complogo" style="normal" weight="normal" />
<font-triplet name="ComplogoMT" style="normal" weight="normal" />
� </font>
</fonts>
</configuration>
BUT -
Obviously I'd like to have more control where I put my font and metric
files so I've attempted numerous ways of specifying a specific path to
locate these files and every combination I've tried has failed.
Here is an example I've tried and the error I get when I run it:
<configuration>
<fonts>
<font metrics-file="C:\Fop-0.20.1\conf\complogoTTF.xml" kerning="yes"
embed-file="C:\Fop-0.20.1\conf\complogo.ttf">
<font-triplet name="Complogo" style="normal" weight="normal" />
<font-triplet name="ComplogoMT" style="normal" weight="normal" />
� </font>
</fonts>
</configuration>
reading user configuration file
building formatting object tree
setting up fonts
[1Failed to read font metrics file C:\Fop-0.20.1\conf\complogoTTF.xml :
File "C:\Fop-0.20.1\conf\complogoTTF.xml" not found.
[2java.lang.RuntimeException: java.lang.NullPointerException
I've checked and rechecked and had others check and recheck that there are
no spelling mistakes in this path. I've pasted it into a command line and
the file opens up - i.e. the path is correct.
I've tried every combination of forward and back slashes I could think of.
I'm sure I've missed a few - at least the one that works :).
Any Suggestions?
Or, do I simply have to accept that FOP will determine where these files
are located on my server?
Any help would be greatly appreciated!
Shawn Lindstrom