(wow dead list on the weekend :))

-----Original Message-----
From: Martin Edge [mailto:martin.e...@asmorphic.net.au] 
Sent: Saturday, 4 July 2009 4:08 PM
To: fop-dev@xmlgraphics.apache.org
Subject: RE: Debugging Fonts Not Being Validated Issue with IF Format.

Hi Guys,

There is a few faults I've isolated via my debugging..

- First fault 
This one seems to affect all output renderers from the IF format where if I
am using a font which does NOT exist, it is not overridden to the base
any,any font, which in turn makes the related renderers fall over because
the font selected is not within the internal collection. 

Once I could isolate which font was failing, and installed it directly into
windows (I did find this strange, because I don't have <auto-register>
enabled) - the document renders fine. 

So I guess what I need to understand is how I could (or could someone) go
about implementing the same font check during the IF -> Output rendering
process.

- Second fault (which actually worked to my benefit)
It seems the auto-register method is AUTOMATICALLY activated during PCL
rendering - my fop conf for PCL is;

<renderer mime="application/vnd.hp-PCL">
      <fonts>
                <directory>d:\dev\pdfbin\fonts\</directory>
      </fonts>
</renderer>

I can see by outputting the font list via: 
 FontInfo fontList = parent.getFontInfo();
 String test = fontList.getFonts().toString();

That there is windows installed fonts being returned. 

- Third Fault
Even if auto-detect is turned on within the font configuration for the PDF
renderer, the collection available to the PDFPainter is only the base FOP
fonts. 

Any advice would be awesome (c:

Thanks
Martin.

-----Original Message-----
From: Martin Edge [mailto:martin.e...@asmorphic.net.au] 
Sent: Saturday, 4 July 2009 2:49 PM
To: fop-dev@xmlgraphics.apache.org
Subject: Debugging Fonts Not Being Validated Issue with IF Format.

Hey Guys,

I am trying to get my FOP processing system working with the latest FOP
trunk, using the IF format. 

Running tests I have found that when I use a custom font (I use Barcode 3 of
9 and 4 -State) I get a failure when using the FO -> IF -> PCL/PDF which
states fontName must be null. 

I am under a reasonable amount of pressure and am happy to try and debug the
issue myself, but any background you could give me on this part of the
system may save me a bunch of time. 

I have Eclipse up and running, building the application and I'm able to
start the fop.bat script with my required arguments and initiate debugging
and step through the code. 

I notice when I use a font that is not in the default set, the system falls
over with a fontName cannot be null error. It seems that if there was any
prior validation on whether a font could be found or not, this process is
thrown out the window when you go from FO -> IF -> PCL/PDF.

For instance, drawText in PDFPainter.java gets called, but the triplet it's
looking for does not exist in the collection returned by
getFontInfo().getInternalFontKey(triplet);

The stack trace is as follows;
SEVERE: Exception
java.lang.NullPointerException: fontName must not be null
      at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:239)
      at org.apache.fop.cli.IFInputHandler.renderTo(IFInputHandler.java:77)
      at org.apache.fop.cli.Main.startFOP(Main.java:174)
      at org.apache.fop.cli.Main.main(Main.java:205)
Caused by: java.lang.NullPointerException: fontName must not be null
      at
org.apache.fop.render.pdf.PDFPainter.getTypeface(PDFPainter.java:246)
      at org.apache.fop.render.pdf.PDFPainter.drawText(PDFPainter.java:269)
      at
org.apache.fop.render.intermediate.IFParser$Handler$TextHandler.endElement(I
FParser.java:487)
      at
org.apache.fop.render.intermediate.IFParser$Handler.endElement(IFParser.java
:277)
      at
org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerI
dentityImpl.java:1101)
      at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
Source)
      at org.apache.xerces.xinclude.XIncludeHandler.endElement(Unknown
Source)
      at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
Source)
      at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatc
her.dispatch(Unknown Source)
      at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
Source

I've gotten myself in a bind where I have a job I should have delivered last
week, and I need to be able to perform the job some way or another. 

I used to use FO - AT - PCL - but the PCL file was way too large, and using
a PCL Page Counter there seemed to be double the amount of pages than there
should have been (no idea whats going wrong there.). It was recommended to
me by Andreas that due to the speed issues I was having, it might be more
optimal to go for the new IF format, and from review of the XML that does
seem to be the way to go. Additionally, due to the PCL file size being a
problem, I could technically split the IF format into chunks before
transporting to PCL. But alas, I am unlucky, and it doesn't seem to work for
custom fonts properly. 

Thanks!
Martin




Reply via email to