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

Possible errors in TrueType table 'name' parsing.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.0.0
    • Component/s: FontBox
    • Labels:
      None
    • Environment:
      Unicode strings

      Description

      Accidentally noticed a possible bug in parsing name records:

      1) Class NamingTable.java, line 165:

      for (int i = 4; i <= 0; i--)

      this loop is never entered, thus, Unicode strings are not considered.

      2) Class NamingTable.java, line 106:

      String string = data.readString(nr.getStringLength(), charset);

      for platform == 0 (Unicode), strings are read in ISO-8859-1 charset, but most likely it should be UTF16 charset.

      This may affect values of the FontFamily and FontSubFamily fields.

        Attachments

          Activity

            People

            • Assignee:
              lehmi Andreas Lehmkühler
              Reporter:
              discintegrator Vladimir Dubrov
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: