Zhichao Yang created PDFBOX-4595:
------------------------------------

             Summary: PDCIDFontType0 getHeight return 0
                 Key: PDFBOX-4595
                 URL: https://issues.apache.org/jira/browse/PDFBOX-4595
             Project: PDFBox
          Issue Type: Bug
          Components: PDModel
    Affects Versions: 2.0.16
            Reporter: Zhichao Yang


In pdmodel/font/PDCIDFontType0.java :

{code: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;
}
{code}
 
When the glyph is already in glyphHeights, getHeight returns 0. 

It can be:

{code: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);
        } else {
            height =  glyphHeights.get(cid);
        }
        return height;
    }
{code}


 



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to