Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-1302

Got ArrayIndexOutOfBoundsException in parsing a Chinese ttf file.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.6.0
    • 1.8.4, 2.0.0
    • FontBox
    • None

    Description

      using this code to parse the ttf file:
      public static void main(String[] args) throws IOException

      { TTFParser parser = new TTFParser(); TrueTypeFont font = parser.parseTTF("C:\\workspace\\downloader\\pdf\\金梅毛行书.TTF"); System.out.println("Font:" + font); }

      got exception with stacktrace:
      Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 41280
      at org.apache.fontbox.ttf.CMAPEncodingEntry.processSubtype2(CMAPEncodingEntry.java:429)
      at org.apache.fontbox.ttf.CMAPEncodingEntry.initSubtable(CMAPEncodingEntry.java:82)
      at org.apache.fontbox.ttf.CMAPTable.initData(CMAPTable.java:90)
      at org.apache.fontbox.ttf.AbstractTTFParser.parseTables(AbstractTTFParser.java:163)
      at org.apache.fontbox.ttf.TTFParser.parseTables(TTFParser.java:61)
      at org.apache.fontbox.ttf.AbstractTTFParser.parseTTF(AbstractTTFParser.java:90)
      at org.apache.fontbox.ttf.TTFParser.parseTTF(TTFParser.java:26)
      at org.apache.fontbox.ttf.AbstractTTFParser.parseTTF(AbstractTTFParser.java:43)
      at org.apache.fontbox.ttf.TTFParser.parseTTF(TTFParser.java:26)
      at elmar.demo.TFFTest.main(TFFTest.java:11)

      Attachments

        1. 金梅毛行书.TTF
          3.64 MB
          Elmar Chen

        Issue Links

          Activity

            People

              lehmi Andreas Lehmkühler
              elmar Elmar Chen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: