Quantcast

Problems ansi encoding in TTF fonts

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Problems ansi encoding in TTF fonts

Jose Sanchez
Hi ,
I generate a pdf file using FOP 0.95 Beta and i am embedding a TTF font, for instance GARAMOND. I generate the appropiate font metrics using TTFReader class.
I have no problems to generate the pdf, but when i use Adobe Reader to view it in, in Document Properties, Fonts, shows the following:

Garamond-Bold (Embedded Subset) Type: TrueType (CID) Encoding: Identity-H.

Then, if i try print the pdf file using JPS (Java Print Service) in the document printed fonts are not showed. This, not occurs when i use one of the fourteen standard fonts of Adobe PDF espec.
I think the problem could be font encoding issues, and i generate the metrics using the option -enc ansi, but when i generate the pdf, i have a FontReader exception:

9:35:44,078 ERROR [STDERR] java.lang.NullPointerException
9:35:44,078 ERROR [STDERR]     at org.apache.fop.fonts.FontReader.endElement(FontReader.java:231)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.fonts.FontReader.createFont(FontReader.java:90)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.fonts.FontReader.<init>(FontReader.java:139)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.fonts.LazyFont.load(LazyFont.java:113)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.fonts.LazyFont.getAscender(LazyFont.java:233)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.fonts.Font.getAscender(Font.java:96)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.layoutmgr.BlockLayoutManager.initialize(BlockLayoutManager.java:87)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.layoutmgr.AbstractLayoutManager.getChildLM(AbstractLayoutManager.java:118)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements(BlockStackingLayoutManager.java:271)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:116)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:107)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.layoutmgr.PageBreaker.getNextKnuthElements(PageBreaker.java:145)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.layoutmgr.AbstractBreaker.getNextBlockList(AbstractBreaker.java:552)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:137)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:302)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:264)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:106)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:234)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:123)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:340)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:169)
9:35:44,078 ERROR [STDERR]     at net.sf.saxon.event.ContentHandlerProxy.endElement(ContentHandlerProxy.java:372)
9:35:44,078 ERROR [STDERR]     at net.sf.saxon.event.NamespaceReducer.endElement(NamespaceReducer.java:192)
9:35:44,078 ERROR [STDERR]     at net.sf.saxon.event.ReceivingContentHandler.endElement(ReceivingContentHandler.java:333)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
9:35:44,078 ERROR [STDERR]     at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:300)
9:35:44,078 ERROR [STDERR]     at net.sf.saxon.event.Sender.send(Sender.java:162)
9:35:44,078 ERROR [STDERR]     at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:29)

Sorry for my English.

Thanks!!!!

José.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problems ansi encoding in TTF fonts

Jose Sanchez
Hi again,

I am trying with the FOP TRUNK and i have the same problem. I think FontReader can´t read fine the font metrics generated with TTFReader or TTFReader generates a bad font metrics structure when i use encoding ansi.

Jose Sanchez wrote
Hi ,
I generate a pdf file using FOP 0.95 Beta and i am embedding a TTF font, for instance GARAMOND. I generate the appropiate font metrics using TTFReader class.
I have no problems to generate the pdf, but when i use Adobe Reader to view it in, in Document Properties, Fonts, shows the following:

Garamond-Bold (Embedded Subset) Type: TrueType (CID) Encoding: Identity-H.

Then, if i try print the pdf file using JPS (Java Print Service) in the document printed fonts are not showed. This, not occurs when i use one of the fourteen standard fonts of Adobe PDF espec.
I think the problem could be font encoding issues, and i generate the metrics using the option -enc ansi, but when i generate the pdf, i have a FontReader exception:

9:35:44,078 ERROR [STDERR] java.lang.NullPointerException
9:35:44,078 ERROR [STDERR]     at org.apache.fop.fonts.FontReader.endElement(FontReader.java:231)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.fonts.FontReader.createFont(FontReader.java:90)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.fonts.FontReader.<init>(FontReader.java:139)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.fonts.LazyFont.load(LazyFont.java:113)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.fonts.LazyFont.getAscender(LazyFont.java:233)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.fonts.Font.getAscender(Font.java:96)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.layoutmgr.BlockLayoutManager.initialize(BlockLayoutManager.java:87)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.layoutmgr.AbstractLayoutManager.getChildLM(AbstractLayoutManager.java:118)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements(BlockStackingLayoutManager.java:271)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:116)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:107)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.layoutmgr.PageBreaker.getNextKnuthElements(PageBreaker.java:145)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.layoutmgr.AbstractBreaker.getNextBlockList(AbstractBreaker.java:552)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:137)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:302)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:264)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:106)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:234)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:123)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:340)
9:35:44,078 ERROR [STDERR]     at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:169)
9:35:44,078 ERROR [STDERR]     at net.sf.saxon.event.ContentHandlerProxy.endElement(ContentHandlerProxy.java:372)
9:35:44,078 ERROR [STDERR]     at net.sf.saxon.event.NamespaceReducer.endElement(NamespaceReducer.java:192)
9:35:44,078 ERROR [STDERR]     at net.sf.saxon.event.ReceivingContentHandler.endElement(ReceivingContentHandler.java:333)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
9:35:44,078 ERROR [STDERR]     at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
9:35:44,078 ERROR [STDERR]     at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:300)
9:35:44,078 ERROR [STDERR]     at net.sf.saxon.event.Sender.send(Sender.java:162)
9:35:44,078 ERROR [STDERR]     at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:29)

Sorry for my English.

Thanks!!!!

José.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problems ansi encoding in TTF fonts

Jeremias Maerki-2
Thanks for reporting that. It's now fixed in the 0.95 branch:
http://svn.apache.org/viewvc?rev=647403&view=rev

On 09.04.2008 18:37:45 Jose Sanchez wrote:

>
> Hi again,
>
> I am trying with the FOP TRUNK and i have the same problem. I think
> FontReader can´t read fine the font metrics generated with TTFReader or
> TTFReader generates a bad font metrics structure when i use encoding ansi.
>
>
> Jose Sanchez wrote:
> >
> > Hi ,
> > I generate a pdf file using FOP 0.95 Beta and i am embedding a TTF font,
> > for instance GARAMOND. I generate the appropiate font metrics using
> > TTFReader class.
> > I have no problems to generate the pdf, but when i use Adobe Reader to
> > view it in, in Document Properties, Fonts, shows the following:
> >
> > Garamond-Bold (Embedded Subset) Type: TrueType (CID) Encoding: Identity-H.
> >
> > Then, if i try print the pdf file using JPS (Java Print Service) in the
> > document printed fonts are not showed. This, not occurs when i use one of
> > the fourteen standard fonts of Adobe PDF espec.
> > I think the problem could be font encoding issues, and i generate the
> > metrics using the option -enc ansi, but when i generate the pdf, i have a
> > FontReader exception:
> >
> > 9:35:44,078 ERROR [STDERR] java.lang.NullPointerException
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.fop.fonts.FontReader.endElement(FontReader.java:231)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
> > Source)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> > Source)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> > Source)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.fop.fonts.FontReader.createFont(FontReader.java:90)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.fop.fonts.FontReader.<init>(FontReader.java:139)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.fop.fonts.LazyFont.load(LazyFont.java:113)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.fop.fonts.LazyFont.getAscender(LazyFont.java:233)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.fop.fonts.Font.getAscender(Font.java:96)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.fop.layoutmgr.BlockLayoutManager.initialize(BlockLayoutManager.java:87)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.fop.layoutmgr.AbstractLayoutManager.getChildLM(AbstractLayoutManager.java:118)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements(BlockStackingLayoutManager.java:271)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:116)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:107)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.fop.layoutmgr.PageBreaker.getNextKnuthElements(PageBreaker.java:145)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.fop.layoutmgr.AbstractBreaker.getNextBlockList(AbstractBreaker.java:552)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:137)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:302)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:264)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:106)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:234)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:123)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:340)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:169)
> > 9:35:44,078 ERROR [STDERR]     at
> > net.sf.saxon.event.ContentHandlerProxy.endElement(ContentHandlerProxy.java:372)
> > 9:35:44,078 ERROR [STDERR]     at
> > net.sf.saxon.event.NamespaceReducer.endElement(NamespaceReducer.java:192)
> > 9:35:44,078 ERROR [STDERR]     at
> > net.sf.saxon.event.ReceivingContentHandler.endElement(ReceivingContentHandler.java:333)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
> > Source)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> > Source)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> > Source)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> > 9:35:44,078 ERROR [STDERR]     at
> > org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
> > 9:35:44,078 ERROR [STDERR]     at
> > net.sf.saxon.event.Sender.sendSAXSource(Sender.java:300)
> > 9:35:44,078 ERROR [STDERR]     at
> > net.sf.saxon.event.Sender.send(Sender.java:162)
> > 9:35:44,078 ERROR [STDERR]     at
> > net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:29)
> >
> > Sorry for my English.
> >
> > Thanks!!!!
> >
> > José.
> >
>
> --
> View this message in context: http://www.nabble.com/Problems-ansi-encoding-in-TTF-fonts-tp16581739p16590556.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
>




Jeremias Maerki


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

Loading...