You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Jon Kofal <jo...@yahoo.com> on 2002/08/07 20:11:01 UTC
Re: Embedded Fonts in FOP 0.20.3
Problem solved.
I don't want to tie myself to a Servlet container, so placing the files
in TOMCAT/bin doesn't work.
What I did is put the userconfig.xml, and all my font.xml and font.dtd
files in my jar file.
My userconfig.xml has the base filenames of the .xml and .ttf files
(metrics-file="MyFont.xml" embed-file="MyFont.ttf").
I access the XML Elements at XPATH //font and add the value of the
javax.servlet.context.tempdir + a file.separator to the front of the
Attribute Value, adding a file:// to the font-metrics to match the
peculiar FOP protocol. (I end up with
(metrics-file="file:///tempDir/MyFont.xml"
embed-file="/tempDir/MyFont.ttf").
I then read all the files from the jar (.xml and .ttf) and write them
to the javax.servlet.context.tempdir.
I write this userconfig.xml to the javax.servlet.context.tempdir.
I then instantiate a org.apache.fop.apps.Options with the just written
userconfig.xml.
This is a pain, but it works.
I'll recommend to the FOP developers to allow for Resources from the
JAR file, not just inflexible File objects.
Jon K
__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com