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

isEmbeddingPermitted() is too restrictive on TTFs with OS2 table versions 0-2

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.21, 3.0.0 PDFBox
    • Fix Version/s: 2.0.24, 3.0.0 PDFBox
    • Component/s: PDModel
    • Labels:
      None

      Description

      PDFBOX-4882 fixed a bug that made isEmbeddingPermitted() too permissive.  But it introduced a bug that made isEmbeddingPermitted() too restrictive for TTFs with OS2 table versions 0-2.

       

      TTFs with OS2 table versions 0-2 can have multiple permission bits set.  According to the spec described in 

      https://docs.microsoft.com/en-us/typography/opentype/spec/os2#fstype

      "in the event that more than one of bits 0 to 3 are set in a given font, then the least-restrictive permission indicated take precedence."

      Unfortunately, the current code essentially makes the most restrictive permission take precedence.  This causes pdfbox to throw an error: 

      "This font does not permit embedding"

      when attempting to process fonts that worked fine in pdfbox v2.0.20 and lower

        Attachments

        1. 2021-05-13_15-20-29.png
          800 kB
          Larry Lynn

          Issue Links

            Activity

              People

              • Assignee:
                tilman Tilman Hausherr
                Reporter:
                larry.lynn@workiva.com Larry Lynn
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: