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

PDCIDFontType0 getHeight return 0

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.16
    • 2.0.17, 3.0.0 PDFBox
    • PDModel
    • None

    Description

      In pdmodel/font/PDCIDFontType0.java :

      public float getHeight(int code) throws IOException
      {
          int cid = codeToCID(code);
      
          float height = 0;
          if (!glyphHeights.containsKey(cid))
          {
              height =  (float) getType2CharString(cid).getBounds().getHeight();
              glyphHeights.put(cid, height);
          }
          return height;
      }
      

       
      When the glyph is already in glyphHeights, getHeight returns 0.

      It can be:

          public float getHeight(int code) throws IOException
          {
              int cid = codeToCID(code);
      
              float height = 0;
              if (!glyphHeights.containsKey(cid))
              {
                  height =  (float) getType2CharString(cid).getBounds().getHeight();
                  glyphHeights.put(cid, height);
              } else {
                  height =  glyphHeights.get(cid);
              }
              return height;
          }
      

       

      Attachments

        Activity

          People

            tilman Tilman Hausherr
            ZhichaoY Zhichao Yang
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: