[ 
https://issues.apache.org/jira/browse/PDFBOX-4595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16883945#comment-16883945
 ] 

ASF subversion and git services commented on PDFBOX-4595:
---------------------------------------------------------

Commit 1862983 from Tilman Hausherr in branch 'pdfbox/branches/issue45'
[ https://svn.apache.org/r1862983 ]

PDFBOX-4595: fix bug that returned 0 instead of cache value, as suggested by 
Zhichao Yang

> 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
>            Priority: Major
>             Fix For: 2.0.17, 3.0.0 PDFBox
>
>
> 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