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

Two conditions are always false in TrueTypeEmbedder.isEmbeddingPermitted

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.20
    • 2.0.21, 3.0.0 PDFBox
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: