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

Robert Meyer commented on PDFBOX-1645:
--------------------------------------

A thousand apologies Andreas as looking back at my old patch, the checks 
weren't there! (https://issues.apache.org/jira/browse/PDFBOX-1505) I should 
have really checked my patch first before making the comments, but at least 
it's a good issue to bring it up regarding the best way to approach it. That is 
strange as I pulled the latest code down yesterday and compiled it this 
morning. I will do it from a fresh copy, add a test and post up the changes 
hopefully sometime soon.

NOTE - I just realised I created a separate patch which is dependant on this 
one, so I'll try and link the two as well.

@Maruan - I agree that the checks are made quite late in the day, but having 
the checks and the warning may prove beneficial in debugging. The warning will 
know which iteration of 6 is causing problems as well give the partial list of 
operands to display to the user. If the check is done earlier, then it may be 
obvious there is a problem, but it is not clear the set of numbers it is having 
issue with. I am certainly open to it though.
                
> [PATCH] Improved the accuracy of the bounding box for each rendered CFF glyph
> -----------------------------------------------------------------------------
>
>                 Key: PDFBOX-1645
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1645
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: FontBox
>    Affects Versions: 1.8.2
>            Reporter: Robert Meyer
>             Fix For: 2.0.0
>
>         Attachments: patch.diff
>
>
> In a previous patch to the CharStringRenderer class, I resolved the rendering 
> issues and added a method to retrieve the bounding box for a CFF glyph. This 
> utilized the GeneralPath.getBounds() method to retrieve it's bounding box. 
> Unfortunately it was found that the method uses the control points of the 
> bezier curves instead of the actual lines and was not very accurate. I have 
> therefore added several new methods to calculate the correct extents of the 
> glyph so that now it matches that of the measurements found in tools like 
> FontForge.
> As a side note, there are several checks which were originally added in my 
> patch which were unfortunately removed relating to the number of arguments 
> provided with an operator. I have one Adobe Font (Adobe Heiti Standard - 
> CID-Keyed OTF) which has one or more glyphs which trip up on this and cause 
> an Array index out of Bounds exception. Each glyph renders correctly even 
> though this issue occurs and therefore would be grateful if these could be 
> left in. I have re-added these checks back with the patch I am about to add.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to