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

PDCIDFontType0 getHeight return 0

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.16
    • Fix Version/s: 2.0.17, 3.0.0 PDFBox
    • Component/s: PDModel
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: