You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Andreas Lehmkühler (JIRA)" <ji...@apache.org> on 2013/09/23 19:33:03 UTC
[jira] [Resolved] (PDFBOX-1283) Unicode characters displayed with
wrong Advance
[ https://issues.apache.org/jira/browse/PDFBOX-1283?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andreas Lehmkühler resolved PDFBOX-1283.
----------------------------------------
Resolution: Fixed
Fix Version/s: 2.0.0
I fixed the issue in revision 1525654. PDFBox now uses a suitable mapping to get the correct width value for a CIDType2 font.
Thanks for the report
> Unicode characters displayed with wrong Advance
> -----------------------------------------------
>
> Key: PDFBOX-1283
> URL: https://issues.apache.org/jira/browse/PDFBOX-1283
> Project: PDFBox
> Issue Type: Bug
> Components: PDFReader
> Affects Versions: 1.6.0
> Reporter: Daniel Schwinn
> Assignee: Andreas Lehmkühler
> Fix For: 2.0.0
>
> Attachments: AnnahmeReport_MitRussischTest_Modified.pdf, AnnahmeReport_MitRussischTest.pdf
>
>
> The file AnnahmeReport_MitRussischTest.pdf is not displayed correctly. The advance of the characters is calculated wrong. The document is displayed correctly in Adobe Reader.
> In PDCIDFont.java the method extractWidths() fills widthCache with the character widths based on the array in the "W" Dictionary. The widthCache seems to translate from from Unicode to character width but the "W" Dictionary translates from CID-code to character width.
> In this PDF file the TTF font is embedded and the CID code is identical to the glyph code in the TTF font. A cmap maps from unicode directly to the cid/gid in the ttf font.
> So this cache is filled in the wrong way or when accessing the cache it is not taken into account that this array containes the widths based on the cid/gid.
> The cmap encoding has to be used when filling the cache or when reading the values from the cache
> I checked if Adobe Reader uses the values in /W to determine the widths to rule out the case that
> the PDF file is faulty and adobe reader just ignores the faulty /W array.
> When changing the entries for the glyphs number 20..23 in the /W array of the bold font
> (first 4 values in the second line of the array which match to characters '1'..'4')
> then the numbers are displayed with wrong widths in AdobeReader while nothing changes in PDFBox.
> (file AnnahmeReport_MitRussischTest_Modified.pdf)
--
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