Return-Path: Delivered-To: apmail-forrest-user-archive@www.apache.org Received: (qmail 41456 invoked from network); 29 Apr 2009 11:58:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Apr 2009 11:58:45 -0000 Received: (qmail 14543 invoked by uid 500); 29 Apr 2009 11:58:45 -0000 Delivered-To: apmail-forrest-user-archive@forrest.apache.org Received: (qmail 14433 invoked by uid 500); 29 Apr 2009 11:58:44 -0000 Mailing-List: contact user-help@forrest.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@forrest.apache.org List-Id: Delivered-To: mailing list user@forrest.apache.org Received: (qmail 14425 invoked by uid 99); 29 Apr 2009 11:58:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Apr 2009 11:58:44 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of hmphipps@gmail.com designates 74.125.46.31 as permitted sender) Received: from [74.125.46.31] (HELO yw-out-2324.google.com) (74.125.46.31) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Apr 2009 11:58:36 +0000 Received: by yw-out-2324.google.com with SMTP id 3so685888ywj.75 for ; Wed, 29 Apr 2009 04:58:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=mrGWoWbaTAWA8Agku6qQEigEZuLScXfa31v1f2v+4Gc=; b=wVgX/7SJ6+byWSjt0fn+Hg3cBY7u1gmyp1kHH12hKaBcJIjDEPJCTHL7cM4kVdgoPL ZybcE+5e0OVPG5bFCRyNA1V8keZlyGIoPZBertBVCKPJN7FEJ4J5aZN+W0+WSKOZyQya kkleXt4dnxKml0uUyRd72rcsYm/oQX9p8RjLk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=h8sBU29OxfzcDbRK45xWCuFJ5Xmh99aWtr6ioozDscSum1nQndegfG8AbBH9mIz7sj xn2+WO7A6YHMEoXXAtKYupyroOa6fRTwntfPuKbkDlRNsbfiTkFZAqqgmUpYwWE8wb89 dkwMSOD2prCzx69CzfQ0OiETUXvp+qNiyxTF0= MIME-Version: 1.0 Received: by 10.100.163.15 with SMTP id l15mr555871ane.22.1241006294921; Wed, 29 Apr 2009 04:58:14 -0700 (PDT) In-Reply-To: <5b817dd80904240218m64084c97gfacd7d2fc9a3bc32@mail.gmail.com> References: <5b817dd80904181724g4c17e565q4f985f3783902fde@mail.gmail.com> <8FE1B7C81F1C45199821DEBB44C95413@jpn.ibsplc.com> <5b817dd80904222319k46afda98s6cbfb0fd4688cdd4@mail.gmail.com> <20090424005410.GC5786@igg.indexgeo.com.au> <5b817dd80904240218m64084c97gfacd7d2fc9a3bc32@mail.gmail.com> Date: Wed, 29 Apr 2009 20:58:14 +0900 Message-ID: <5b817dd80904290458k5e1969e8v4a6620d04efa9332@mail.gmail.com> Subject: Re: Japanese PDF rendering From: Heather Phipps To: user@forrest.apache.org Content-Type: multipart/alternative; boundary=0016e642d3b85f73ac0468b04bc3 X-Virus-Checked: Checked by ClamAV on apache.org --0016e642d3b85f73ac0468b04bc3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I have an update and some further questions. The Japanese font display issue is only occurring with my DocBook XML source files. These are not handled by document2fo.xsl, but rather by the DocBook 4.4 stylesheets, which I downloaded and included on my own. Here is an excerpt from my project sitemap showing how I did this: I didn't feel like messing around in the the DocBook stylesheets just yet, so I hacked the font config file to see if I could get other (non-Japanese) fonts to display properly in my PDFs generated from DocBook. Here is the hacked font config file: This works...it causes the PDFs created from both sample XML files included in the demo site and my DocBook XML files to use the "Brush Script" font. However, when I attempt the same thing with a Japanese font, it works properly for the sample XML files (even when I add some Japanese text) but not for my DocBook XML files...I get the following out of memory error: * [54/14] [0/0] 9.776s 0b samples/dotnet.pdf Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:95) at org.apache.fop.tools.IOUtil.copyStream(IOUtil.java:77) at org.apache.fop.tools.IOUtil.toByteArray(IOUtil.java:95) at org.apache.fop.fonts.FontFileReader.init(FontFileReader.java:76) at org.apache.fop.fonts.FontFileReader.(FontFileReader.java:105) at org.apache.fop.render.pdf.fonts.MultiByteFont.getFontFile(MultiByteFont.java:237) at org.apache.fop.render.pdf.fonts.LazyFont.getFontFile(LazyFont.java:218) at org.apache.fop.pdf.PDFDocument.makeFontDescriptor(PDFDocument.java:974) at org.apache.fop.pdf.PDFDocument.makeFont(PDFDocument.java:875) at org.apache.fop.render.pdf.FontSetup.addToResources(FontSetup.java:250) at org.apache.fop.render.pdf.PDFRenderer.stopRenderer(PDFRenderer.java:249) at org.apache.fop.apps.StreamRenderer.stopRenderer(StreamRenderer.java:204) at org.apache.fop.fo.FOTreeBuilder.endDocument(FOTreeBuilder.java:246) at org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:55) at org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:55) at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.cocoon.core.container.handler.PoolableComponentHandler$ProxyHandler.invoke(PoolableComponentHandler.java:147) at $Proxy6.endDocument(Unknown Source) at org.apache.cocoon.components.sax.XMLTeePipe.endDocument(XMLTeePipe.java:67) at org.apache.xml.serializer.ToXMLSAXHandler.endDocument(ToXMLSAXHandler.java:181) at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1378) at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3458) at org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:406) at org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:55) at org.apache.cocoon.transformation.TraxTransformer.endDocument(TraxTransformer.java:585) at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.endDocument(Unknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source) at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source) at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source) Anyone seen this before? Thoughts/suggestions? I'm first going to try to change the heap memory applied to Forrest, hoping that this will change the heap memory applied to FOP...and also maybe try updating the FOP jar that is included with Forrest. --0016e642d3b85f73ac0468b04bc3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I have an update and some further questions.

The Japanese font displ= ay issue is only occurring with my DocBook XML source files.=A0 These are n= ot handled by document2fo.xsl, but rather by the DocBook 4.4 stylesheets, w= hich I downloaded and included on my own.=A0 Here is an excerpt from my pro= ject sitemap showing how I did this:

=A0=A0 <map:match pattern=3D"**.pdf">
=A0=A0=A0 <= map:act type=3D"sourcetype" src=3D"{properties:content.xdocs= }{1}.xml">
=A0=A0=A0=A0 <map:select type=3D"parameter&qu= ot;>
=A0=A0=A0=A0=A0 <map:parameter name=3D"parameter-selecto= r-test" value=3D"{sourcetype}"/>
=A0=A0=A0=A0=A0 <map:when test=3D"docbook-v4.4">
=A0=A0= =A0=A0=A0=A0 <map:generate src=3D"{properties:content.xdocs}{../1}.= xml"/>
=A0=A0=A0=A0=A0=A0 <map:transform
=A0=A0=A0=A0=A0= =A0=A0=A0=A0 src=3D"{properties:resources.stylesheets}/docbook-xsl-1.7= 4.3-pre 2/fo/docbook.xsl"/>
=A0=A0=A0=A0=A0=A0 <map:serialize type=3D"fo2pdf"/>
=A0= =A0=A0=A0=A0 </map:when>
=A0=A0=A0=A0 </map:select>
=A0= =A0=A0 </map:act>
=A0=A0 </map:match>

I didn't fe= el like messing around in the the DocBook stylesheets just yet, so I hacked= the font config file to see if I could get other (non-Japanese) fonts to d= isplay properly in my PDFs generated from DocBook.=A0 Here is the hacked fo= nt config file:

<?xml version=3D"1.0" encoding=3D"UTF-8"?><configuration>
<fonts>
=A0<font metrics-file=3D"= ;/Users/Heather/apache-forrest-0.8/main/webapp/resources/fonts/Brush_Script= .xml" embed-file=3D"/Users/Heather/apache-forrest-0.8/main/webapp= /resources/fonts/Brush_Script.ttf" kerning=3D"yes">
=A0 <font-triplet name=3D"serif" style=3D"normal" we= ight=3D"normal"/>
=A0 <font-triplet name=3D"serif&q= uot; style=3D"normal" weight=3D"bold"/>
=A0 <f= ont-triplet name=3D"serif" style=3D"italic" weight=3D&q= uot;normal"/>
=A0 <font-triplet name=3D"serif" style=3D"italic" we= ight=3D"bold"/>
=A0 <font-triplet name=3D"sans-seri= f" style=3D"normal" weight=3D"normal"/>
=A0 = <font-triplet name=3D"sans-serif" style=3D"normal" w= eight=3D"bold"/>
=A0 <font-triplet name=3D"sans-serif" style=3D"italic&quo= t; weight=3D"normal"/>
=A0 <font-triplet name=3D"sa= ns-serif" style=3D"italic" weight=3D"bold"/>=A0 <font-triplet name=3D"sans" style=3D"normal" we= ight=3D"normal"/>
=A0 <font-triplet name=3D"sans" style=3D"normal" wei= ght=3D"bold"/>
=A0 <font-triplet name=3D"sans"= style=3D"italic" weight=3D"normal"/>
=A0 <fon= t-triplet name=3D"sans" style=3D"italic" weight=3D"= ;bold"/>
=A0 <font-triplet name=3D"monospace" style=3D"normal"= ; weight=3D"normal"/>
=A0 <font-triplet name=3D"mon= ospace" style=3D"normal" weight=3D"bold"/>
= =A0 <font-triplet name=3D"monospace" style=3D"italic"= ; weight=3D"normal"/>
=A0 <font-triplet name=3D"monospace" style=3D"italic"= ; weight=3D"bold"/>
=A0</font>
</fonts>
&= lt;/configuration>

This works...it causes the PDFs created from b= oth sample XML files included in the demo site and my DocBook XML files to = use the "Brush Script" font.=A0 However, when I attempt the same = thing with a Japanese font, it works properly for the sample XML files (eve= n when I add some Japanese text) but not for my DocBook XML files...I get t= he following out of memory error:

* [54/14]=A0=A0 [0/0]=A0=A0=A0=A0 9.776s 0b=A0=A0=A0=A0=A0 samples/dotn= et.pdf
Exception in thread "main" java.lang.OutOfMemoryError: = Java heap space
=A0=A0=A0 at java.io.ByteArrayOutputStream.write(ByteArr= ayOutputStream.java:95)
=A0=A0=A0 at org.apache.fop.tools.IOUtil.copyStream(IOUtil.java:77)
=A0= =A0=A0 at org.apache.fop.tools.IOUtil.toByteArray(IOUtil.java:95)
=A0=A0= =A0 at org.apache.fop.fonts.FontFileReader.init(FontFileReader.java:76)
= =A0=A0=A0 at org.apache.fop.fonts.FontFileReader.<init>(FontFileReade= r.java:105)
=A0=A0=A0 at org.apache.fop.render.pdf.fonts.MultiByteFont.getFontFile(Mult= iByteFont.java:237)
=A0=A0=A0 at org.apache.fop.render.pdf.fonts.LazyFon= t.getFontFile(LazyFont.java:218)
=A0=A0=A0 at org.apache.fop.pdf.PDFDocu= ment.makeFontDescriptor(PDFDocument.java:974)
=A0=A0=A0 at org.apache.fop.pdf.PDFDocument.makeFont(PDFDocument.java:875)<= br>=A0=A0=A0 at org.apache.fop.render.pdf.FontSetup.addToResources(FontSetu= p.java:250)
=A0=A0=A0 at org.apache.fop.render.pdf.PDFRenderer.stopRende= rer(PDFRenderer.java:249)
=A0=A0=A0 at org.apache.fop.apps.StreamRenderer.stopRenderer(StreamRenderer= .java:204)
=A0=A0=A0 at org.apache.fop.fo.FOTreeBuilder.endDocument(FOTr= eeBuilder.java:246)
=A0=A0=A0 at org.apache.cocoon.xml.AbstractXMLPipe.e= ndDocument(AbstractXMLPipe.java:55)
=A0=A0=A0 at org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLP= ipe.java:55)
=A0=A0=A0 at sun.reflect.GeneratedMethodAccessor37.invoke(U= nknown Source)
=A0=A0=A0 at sun.reflect.DelegatingMethodAccessorImpl.inv= oke(DelegatingMethodAccessorImpl.java:25)
=A0=A0=A0 at java.lang.reflect.Method.invoke(Method.java:585)
=A0=A0=A0 = at org.apache.cocoon.core.container.handler.PoolableComponentHandler$ProxyH= andler.invoke(PoolableComponentHandler.java:147)
=A0=A0=A0 at $Proxy6.en= dDocument(Unknown Source)
=A0=A0=A0 at org.apache.cocoon.components.sax.XMLTeePipe.endDocument(XMLTee= Pipe.java:67)
=A0=A0=A0 at org.apache.xml.serializer.ToXMLSAXHandler.end= Document(ToXMLSAXHandler.java:181)
=A0=A0=A0 at org.apache.xalan.transfo= rmer.TransformerImpl.transformNode(TransformerImpl.java:1378)
=A0=A0=A0 at org.apache.xalan.transformer.TransformerImpl.run(TransformerIm= pl.java:3458)
=A0=A0=A0 at org.apache.xalan.transformer.TransformerHandl= erImpl.endDocument(TransformerHandlerImpl.java:406)
=A0=A0=A0 at org.apa= che.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:55)
=A0=A0=A0 at org.apache.cocoon.transformation.TraxTransformer.endDocument(T= raxTransformer.java:585)
=A0=A0=A0 at org.apache.xerces.parsers.Abstract= SAXParser.endDocument(Unknown Source)
=A0=A0=A0 at org.apache.xerces.imp= l.dtd.XMLDTDValidator.endDocument(Unknown Source)
=A0=A0=A0 at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknow= n Source)
=A0=A0=A0 at org.apache.xerces.impl.XMLEntityManager.endEntity= (Unknown Source)
=A0=A0=A0 at org.apache.xerces.impl.XMLEntityScanner.lo= ad(Unknown Source)


Anyone seen this before?=A0 Thoughts/suggestions?=A0 I'm first = going to try to change the heap memory applied to Forrest, hoping that this= will change the heap memory applied to FOP...and also maybe try updating t= he FOP jar that is included with Forrest.
--0016e642d3b85f73ac0468b04bc3--