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

Issue in FontMapperImpl#isCharSetMatch when font codePageRange is -1

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.0.16
    • Fix Version/s: 2.0.18, 3.0.0 PDFBox
    • Component/s: PDModel
    • Labels:
      None

      Description

      Hi I met an issue with a font.

      It seems to me that code page range has not been set and then in org.apache.pdfbox.pdmodel.font.FontMapperImpl#isCharSetMatch -1 is used.

      It seems to me that -1 means "open bar".

      I was trying to find a font that matches CHINESE_SIMPLIFIED (cidSystemInfo.getOrdering().equals("GB1")), and due to the -1 this font was matched and unluckily it was the one picked.

      Do you think we can make a special case for -1 (return false)?

      Is there any font currently that matches all code page ranges?

       

        Attachments

        1. screenshot-1.png
          21 kB
          Tilman Hausherr
        2. OcrB Regular.ttf
          67 kB
          Struve Pierre

          Activity

            People

            • Assignee:
              tilman Tilman Hausherr
              Reporter:
              tiaped Struve Pierre
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: