[
https://issues.apache.org/jira/browse/PDFBOX-1505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13568183#comment-13568183
]
Robert Meyer commented on PDFBOX-1505:
--------------------------------------
Thanks for the link. I was going to mention the widths as although I left those
lines in there to keep existing functionality, I don't think they are correct.
The width is being set on operators such as vhCurveTo, hvCurveTo and numerous
moveTo commands where none of the values being used represent the characters
width. The only exception to this is the endChar operator. I am not sure if it
is the same, but if an endChar operator does not have a value (as seems to be
the case with my fonts) and it doesn't exist elsewhere in the font, then it
could calculated by using the bounding box values maxX - minX with the patch.
> [PATCH] CharStringRenderer does not render CharString data correctly for Type
> 2 CFF fonts
> -----------------------------------------------------------------------------------------
>
> Key: PDFBOX-1505
> URL: https://issues.apache.org/jira/browse/PDFBOX-1505
> Project: PDFBox
> Issue Type: Bug
> Components: FontBox
> Affects Versions: 2.0.0
> Reporter: Robert Meyer
> Priority: Minor
> Fix For: 2.0.0
>
> Attachments: patch.diff, pic1.PNG
>
>
> I have a requirement to render the characters from a OTF CFF font and to get
> the bounding box for each character. I initially tried to use the
> CharStringRenderer but found the bounding box data was very different to the
> actual characters. Because the renderer outputs the character as a
> GeneralPath, I was able to draw this to a bitmap and view it. What I found
> was that the characters were not being drawn correctly which was effecting
> the bounds. I will post an image and patch in a moment to show the issue and
> resolution I used.
--
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