Please reply to listserv and me directly as I don't yet have confirmation
for being on the listserv... john . dhom @ cgiusa . com
I see no fop user type listserv and this is way too specific for general xml
discussion... so here goes.

First, I have a servlet that is grabbing data from Oracle as XML, using XSLT
to transform it into a XSLFO document, and pushing it out to the browser as
a PDF document via FOP.  Pretty cool.  I'm in desperate need of adding
barcode fonts to these documents.

I have 3 trouble areas regarding importing/using fonts with FOP 0.19.0-CVS.
I figured it was most straight forward to test this stuff via the
command-line xface first, then add it to my servlet.

1) For Type 1 font, font metric xml file builds but FOP generates the
following error when reading the userconfig.xml file.  Of course the file
does exist at the specified location.  The documentation makes no mention of
whether FOP is looking for a Type 1 binary or ascii file.  Since I can't get
past reading the metrics file I don't know if .pfa or .pfb is expected.

        =====
        C:\Fop-0.19.0-CVS>java -cp
        
fop.jar;lib\batik.jar;lib\xalan-2.0.0.jar;lib\xerces-1.2.3.jar;lib\jimi-
        1.0.jar org.apache.fop.apps.Fop -c conf\userconfig.xml /fonts.fo
        /fonts.pdf

        reading user configuration file
        FOP 0.19.0-CVS
        using SAX parser org.apache.xerces.parsers.SAXParser
        building formatting object tree
        setting up fonts
        Failed to read font metrics file c:\fonts\SAdHC39a.xml : File
        "c:\fonts\SAdHC39a.xml" not found.
        formatting FOs into areas
         [1
        WARNING: unknown font sAdHC39a,normal,normal so defaulted font to
any

        C:\Fop-0.19.0-CVS>dir c:\fonts\SAdHC39a.xml
           Directory of c:\fonts
           07/25/2001  05:19p               7,303 SAdHC39a.xml

        ===== FONTS SECTION OF conf/userconfig.xml =====
        <fonts>
          <font metrics-file="c:\fonts\SAdHC39a.xml" kerning="yes"
embed-file="c:\fonts\SAdHC39a.pfa">
                <font-triplet name="SAdHC39a" style="normal"
weight="normal"/>
          </font>
        </fonts>
        =====


2) TTFReader has blown up an 6 different downloaded barcode fonts with a
CMap error:

        =====
        C:\fonts>java org.apache.fop.fonts.apps.TTFReader SAdHC39a.TTF
SAdHC39a.xml
        TTF Reader v1.1.1

        Reading SAdHC39a.TTF...

        Number of glyphs in font: 332
        Unicode cmap table not present
        java.util.NoSuchElementException: Vector Enumeration
                at java.util.Vector$1.nextElement(Vector.java:293)
                at
org.apache.fop.fonts.TTFFile.createCMaps(TTFFile.java:407)
                at org.apache.fop.fonts.TTFFile.readFont(TTFFile.java:396)
                at
org.apache.fop.fonts.apps.TTFReader.loadTTF(TTFReader.java:183)
                at
org.apache.fop.fonts.apps.TTFReader.main(TTFReader.java:145)
        =====

3) I can find no documentation on using imported fonts in my servlet.  I see
the -c commandline parameter to specify a configuration file.  I looked at
some of that code, Fop, and found the Options class and a few others.  How
do I load conf/userconfig.xml in my Driver within my servlet?  Currently I'm
using this form:
Driver fopDriver = new Driver( InputSource, ByteArrayOutputStream ); to
create the driver.

        1) Is loadStandardConfiguration() always called? meaning if I create
/conf/config.xml and put my font references there will it work?

        2) loadUserconfiguration() look promising... do you instantiate a
new Driver() and then load a configuration? How?

As an aside it looks to me that the fop-uml documentation does not match the
source code... for instance the class diagram for org.apache.fop.apps shows
Driver with loadStandardConfiguration() and loadUserconfiguration() as
methods... there are part of the Options class.  And shouldn't that be
loadUserConfiguration()?

Many Thanks,

/jhd


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to