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

Issue in FontMapperImpl#isCharSetMatch when font codePageRange is -1

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 2.0.16
    • 2.0.18, 3.0.0 PDFBox
    • PDModel
    • 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. OcrB Regular.ttf
          67 kB
          Struve Pierre
        2. screenshot-1.png
          21 kB
          Tilman Hausherr

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: