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

Two conditions are always false in TrueTypeEmbedder.isEmbeddingPermitted

    XMLWordPrintableJSON

    Details

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

      Description

       

      IntelliJ says the 2 conditions bellow are always false in TrueTypeEmbedder

      private boolean isEmbeddingPermitted(TrueTypeFont ttf) throws IOException
      {
          if (ttf.getOS2Windows() != null)
          {
              int fsType = ttf.getOS2Windows().getFsType();
              int exclusive = fsType & 0x8; // bits 0-3 are a set of exclusive bits
      
              if ((exclusive & OS2WindowsMetricsTable.FSTYPE_RESTRICTED) ==
                               OS2WindowsMetricsTable.FSTYPE_RESTRICTED)
              {
                  // restricted License embedding
                  return false;
              }
              else if ((exclusive & OS2WindowsMetricsTable.FSTYPE_BITMAP_ONLY) ==
                                   OS2WindowsMetricsTable.FSTYPE_BITMAP_ONLY)
              {
                  // bitmap embedding only
                  return false;
              }
          }
          return true;
      }
      

      Can this be a bug?

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tilman Tilman Hausherr
                Reporter:
                Faltiska Alfred
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: