Uploaded image for project: 'FOP'
  1. FOP
  2. FOP-2738

ArrayIndexOutOfBoundsException in GlyphMapping.addToLetterAdjust

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 2.2
    • None
    • fo/inline
    • None
    • Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
      Windows
    • FOP

    Description

      The following exception happens while rendering to a PDF file:

            [fop] SEVERE: SVG graphic could not be rendered. Reason: java.lang.ArrayIndexOutOfBoundsException: 5
            [fop] java.lang.ArrayIndexOutOfBoundsException: 5
            [fop]     at org.apache.fop.fonts.GlyphMapping.addToLetterAdjust(GlyphMapping.java:286)
            [fop]     at org.apache.fop.fonts.GlyphMapping.processWordNoMapping(GlyphMapping.java:248)
            [fop]     at org.apache.fop.fonts.GlyphMapping.doGlyphMapping(GlyphMapping.java:93)
            [fop]     at org.apache.fop.svg.font.FOPGVTGlyphVector.performDefaultLayout(FOPGVTGlyphVector.java:94)
            [fop]     at org.apache.batik.bridge.GlyphLayout.doExplicitGlyphLayout(Unknown Source)
            [fop]     at org.apache.batik.bridge.GlyphLayout.adjustTextSpacing(Unknown Source)
            [fop]     at org.apache.batik.bridge.GlyphLayout.getAdvance2D(Unknown Source)
            [fop]     at org.apache.batik.bridge.StrokingTextPainter.getTextChunk(Unknown Source)
            [fop]     at org.apache.batik.bridge.StrokingTextPainter.computeTextRuns(Unknown Source)
            [fop]     at org.apache.fop.svg.NativeTextPainter.computeTextRuns(NativeTextPainter.java:223)
            [fop]     at org.apache.batik.bridge.StrokingTextPainter.getTextRuns(Unknown Source)
            [fop]     at org.apache.batik.bridge.StrokingTextPainter.getBounds2D(Unknown Source)
            [fop]     at org.apache.batik.bridge.TextNode.getPrimitiveBounds(Unknown Source)
            [fop]     at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedPrimitiveBounds(Unknown Source)
            [fop]     at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(Unknown Source)
            [fop]     at org.apache.batik.gvt.CompositeGraphicsNode.getPrimitiveBounds(Unknown Source)
            [fop]     at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedPrimitiveBounds(Unknown Source)
            [fop]     at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(Unknown Source)
            [fop]     at org.apache.batik.gvt.CompositeGraphicsNode.getPrimitiveBounds(Unknown Source)
            [fop]     at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedPrimitiveBounds(Unknown Source)
            [fop]     at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(Unknown Source)
            [fop]     at org.apache.batik.gvt.CompositeGraphicsNode.getPrimitiveBounds(Unknown Source)
            [fop]     at org.apache.batik.gvt.AbstractGraphicsNode.getBounds(Unknown Source)
            [fop]     at org.apache.batik.gvt.AbstractGraphicsNode.paint(Unknown Source)
            [fop]     at org.apache.fop.render.pdf.PDFImageHandlerSVG.handleImage(PDFImageHandlerSVG.java:208)
            [fop]     at org.apache.fop.render.intermediate.AbstractIFPainter.drawImage(AbstractIFPainter.java:249)
            [fop]     at org.apache.fop.render.intermediate.AbstractIFPainter.drawImage(AbstractIFPainter.java:205)
            [fop]     at org.apache.fop.render.intermediate.AbstractIFPainter.drawImageUsingImageHandler(AbstractIFPainter.java:170)
            [fop]     at org.apache.fop.render.pdf.PDFPainter.drawImageUsingURI(PDFPainter.java:215)
            [fop]     at org.apache.fop.render.pdf.PDFPainter.drawImage(PDFPainter.java:180)
            [fop]     at org.apache.fop.render.intermediate.IFRenderer.drawImage(IFRenderer.java:1296)
            [fop]     at org.apache.fop.render.intermediate.IFRenderer.renderImage(IFRenderer.java:1283)
            [fop]     at org.apache.fop.render.AbstractRenderer.renderInlineViewport(AbstractRenderer.java:858)
            [fop]     at org.apache.fop.render.AbstractPathOrientedRenderer.renderInlineViewport(AbstractPathOrientedRenderer.java:832)
            [fop]     at org.apache.fop.render.intermediate.IFRenderer.renderInlineViewport(IFRenderer.java:864)
            [fop]     at org.apache.fop.render.AbstractRenderer.renderInlineArea(AbstractRenderer.java:715)
            [fop]     at org.apache.fop.render.intermediate.IFRenderer.renderInlineArea(IFRenderer.java:928)
            [fop]     at org.apache.fop.render.AbstractRenderer.renderInlineParent(AbstractRenderer.java:822)
            [fop]     at org.apache.fop.render.intermediate.IFRenderer.renderInlineParent(IFRenderer.java:945)
            [fop]     at org.apache.fop.render.AbstractRenderer.renderInlineArea(AbstractRenderer.java:709)
            [fop]     at org.apache.fop.render.intermediate.IFRenderer.renderInlineArea(IFRenderer.java:928)
            [fop]     at org.apache.fop.render.AbstractRenderer.renderLineArea(AbstractRenderer.java:690)
            [fop]     at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:572)
            [fop]     at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
            [fop]     at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:1000)
            [fop]     at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
            [fop]     at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
            [fop]     at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:1000)
            [fop]     at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
            [fop]     at org.apache.fop.render.AbstractPathOrientedRenderer.renderReferenceArea(AbstractPathOrientedRenderer.java:757)
            [fop]     at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:600)
            [fop]     at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:1000)
            [fop]     at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
            [fop]     at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
            [fop]     at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:1000)
            [fop]     at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
            [fop]     at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
            [fop]     at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:1000)
            [fop]     at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
            [fop]     at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
            [fop]     at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:1000)
            [fop]     at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
            [fop]     at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
            [fop]     at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:1000)
            [fop]     at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
            [fop]     at org.apache.fop.render.AbstractRenderer.renderFlow(AbstractRenderer.java:457)
            [fop]     at org.apache.fop.render.AbstractPathOrientedRenderer.renderFlow(AbstractPathOrientedRenderer.java:785)
            [fop]     at org.apache.fop.render.AbstractRenderer.renderMainReference(AbstractRenderer.java:434)
            [fop]     at org.apache.fop.render.AbstractRenderer.renderBodyRegion(AbstractRenderer.java:358)
            [fop]     at org.apache.fop.render.AbstractRenderer.renderRegionViewport(AbstractRenderer.java:305)
            [fop]     at org.apache.fop.render.intermediate.IFRenderer.renderRegionViewport(IFRenderer.java:739)
            [fop]     at org.apache.fop.render.AbstractRenderer.renderPageAreas(AbstractRenderer.java:270)
            [fop]     at org.apache.fop.render.AbstractRenderer.renderPage(AbstractRenderer.java:243)
            [fop]     at org.apache.fop.render.intermediate.IFRenderer.renderPage(IFRenderer.java:587)
            [fop]     at org.apache.fop.area.RenderPagesModel.addPage(RenderPagesModel.java:123)
            [fop]     at org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.finishPage(AbstractPageSequenceLayoutManager.java:315)
            [fop]     at org.apache.fop.layoutmgr.PageSequenceLayoutManager.finishPage(PageSequenceLayoutManager.java:216)
            [fop]     at org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.makeNewPage(AbstractPageSequenceLayoutManager.java:286)
            [fop]     at org.apache.fop.layoutmgr.PageSequenceLayoutManager.makeNewPage(PageSequenceLayoutManager.java:176)
            [fop]     at org.apache.fop.layoutmgr.PageBreaker.handleBreakBeforeFollowingPage(PageBreaker.java:648)
            [fop]     at org.apache.fop.layoutmgr.PageBreaker.handleBreakTrait(PageBreaker.java:635)
            [fop]     at org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:172)
            [fop]     at org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:160)
            [fop]     at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:388)
            [fop]     at org.apache.fop.layoutmgr.PageBreaker.doLayout(PageBreaker.java:114)
            [fop]     at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:138)
            [fop]     at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:267)
            [fop]     at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:130)
            [fop]     at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:360)
            [fop]     at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:190)
      

      This issue is similar to FOP-2572 and FOP-2572, however, in my case there aren't any special symbols used. The issue disappears when <complex-scripts disabled="true"/> parameter is removed, however, this parameter is needed with this image due to FOP-2617.

      Steps to reproduce: run

      fop -c fop.conf fop1.fo fop1.pdf
      

      Attachments

        1. fop.conf
          0.3 kB
          Vlad Ivanov
        2. fop1.fo
          1 kB
          Vlad Ivanov
        3. image.svg
          0.8 kB
          Vlad Ivanov

        Activity

          People

            Unassigned Unassigned
            vladislav Vlad Ivanov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: