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

IndexOutOfBoundsException when retrieving kerning information

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.0, 2.0.1, 2.0.2, 3.0.0 PDFBox
    • Fix Version/s: 2.0.2, 3.0.0 PDFBox
    • Component/s: FontBox
    • Labels:
      None

      Description

      When using TrueTypeFont::getKerning there is a large possibility that you will run into an out of bounds exception. This is because the binary search is split into two parts, and the second part incorrectly adds the offset to the found index.

      Actually, with the current implementation there is no need to split the search into two parts. This is only 'needed' when using a binary search implementation which is optimised for cases where the length of the array is a power of two, which Arrays::binarySearch doesn't implement.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tilman Tilman Hausherr
                Reporter:
                ntkoopman Tim Koopman
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: