[ 
https://issues.apache.org/jira/browse/FOP-2572?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15405631#comment-15405631
 ] 

Heiko commented on FOP-2572:
----------------------------

Since [~matthias8283]'s patch also seems to work for FOP-2635, maybe you can 
use the quite small [example 
file|https://www.dropbox.com/s/3r9wrt7od0pwu2p/svg-Files.zip?dl=0] I provided 
there for a unit test.
(Just trying to help, so the patch finds its way to the Maven repo...)

> [PATCH] Non-breaking space within a Text node causes an Exception.
> ------------------------------------------------------------------
>
>                 Key: FOP-2572
>                 URL: https://issues.apache.org/jira/browse/FOP-2572
>             Project: FOP
>          Issue Type: Bug
>          Components: fo/inline
>    Affects Versions: 2.0
>         Environment: All
>            Reporter: Karl Snyder
>         Attachments: fop-2572.patch
>
>
> A non-breaking space (Option+Space on the Mac) in content will cause the 
> following exception.
> {code}java.lang.ArrayIndexOutOfBoundsException: 14
>       at 
> org.apache.fop.fonts.GlyphMapping.addToLetterAdjust(GlyphMapping.java:286) 
> ~[fop-2.0.jar:na]
>       at 
> org.apache.fop.fonts.GlyphMapping.processWordNoMapping(GlyphMapping.java:248) 
> ~[fop-2.0.jar:na]
>       at 
> org.apache.fop.fonts.GlyphMapping.doGlyphMapping(GlyphMapping.java:93) 
> ~[fop-2.0.jar:na]
>       at 
> org.apache.fop.svg.font.FOPGVTGlyphVector.performDefaultLayout(FOPGVTGlyphVector.java:94)
>  ~[fop-2.0.jar:na]
>       at org.apache.batik.bridge.GlyphLayout.doExplicitGlyphLayout(Unknown 
> Source) ~[batik-bridge-1.8.jar:1.8]
>       at org.apache.batik.bridge.GlyphLayout.adjustTextSpacing(Unknown 
> Source) ~[batik-bridge-1.8.jar:1.8]
>       at org.apache.batik.bridge.GlyphLayout.getAdvance2D(Unknown Source) 
> ~[batik-bridge-1.8.jar:1.8]
>       at org.apache.batik.bridge.StrokingTextPainter.getTextChunk(Unknown 
> Source) ~[batik-bridge-1.8.jar:1.8]
>       at org.apache.batik.bridge.StrokingTextPainter.computeTextRuns(Unknown 
> Source) ~[batik-bridge-1.8.jar:1.8]
>       at 
> org.apache.fop.svg.NativeTextPainter.computeTextRuns(NativeTextPainter.java:223)
>  ~[fop-2.0.jar:na]
>       at org.apache.batik.bridge.StrokingTextPainter.getTextRuns(Unknown 
> Source) ~[batik-bridge-1.8.jar:1.8]
>       at org.apache.batik.bridge.StrokingTextPainter.getBounds2D(Unknown 
> Source) ~[batik-bridge-1.8.jar:1.8]
>       at org.apache.batik.bridge.TextNode.getPrimitiveBounds(Unknown Source) 
> ~[batik-bridge-1.8.jar:1.8]
>       at 
> org.apache.batik.gvt.AbstractGraphicsNode.getTransformedPrimitiveBounds(Unknown
>  Source) ~[batik-gvt-1.8.jar:1.8]
>       at 
> org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(Unknown 
> Source) ~[batik-gvt-1.8.jar:1.8]
>       at 
> org.apache.batik.gvt.CompositeGraphicsNode.getPrimitiveBounds(Unknown Source) 
> ~[batik-gvt-1.8.jar:1.8]
>       at 
> org.apache.batik.gvt.CompositeGraphicsNode.getTransformedPrimitiveBounds(Unknown
>  Source) ~[batik-gvt-1.8.jar:1.8]
>       at 
> org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(Unknown 
> Source) ~[batik-gvt-1.8.jar:1.8]
>       at 
> org.apache.batik.gvt.CompositeGraphicsNode.getPrimitiveBounds(Unknown Source) 
> ~[batik-gvt-1.8.jar:1.8]
>       at 
> org.apache.batik.gvt.CompositeGraphicsNode.getTransformedPrimitiveBounds(Unknown
>  Source) ~[batik-gvt-1.8.jar:1.8]
>       at 
> org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(Unknown 
> Source) ~[batik-gvt-1.8.jar:1.8]
>       at 
> org.apache.batik.gvt.CompositeGraphicsNode.getPrimitiveBounds(Unknown Source) 
> ~[batik-gvt-1.8.jar:1.8]
>       at 
> org.apache.batik.gvt.CompositeGraphicsNode.getTransformedPrimitiveBounds(Unknown
>  Source) ~[batik-gvt-1.8.jar:1.8]
>       at 
> org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(Unknown 
> Source) ~[batik-gvt-1.8.jar:1.8]
>       at 
> org.apache.batik.gvt.CompositeGraphicsNode.getPrimitiveBounds(Unknown Source) 
> ~[batik-gvt-1.8.jar:1.8]
>       at org.apache.batik.gvt.AbstractGraphicsNode.getBounds(Unknown Source) 
> ~[batik-gvt-1.8.jar:1.8]
>       at org.apache.batik.gvt.AbstractGraphicsNode.paint(Unknown Source) 
> ~[batik-gvt-1.8.jar:1.8]
>       at org.apache.fop.svg.PDFTranscoder.transcode(PDFTranscoder.java:185) 
> ~[fop-2.0.jar:na]
>       at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown 
> Source) ~[batik-transcoder-1.8.jar:1.8]
>       at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown 
> Source) ~[batik-transcoder-1.8.jar:1.8]
> ...{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to