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

Tilman Hausherr commented on PDFBOX-1740:
-----------------------------------------

After a lot of unsuccessful debugging, I had a look at the code of PDF.js
https://github.com/mozilla/pdf.js/blob/c0d17013a28ee7aa048831560b6494a26c52360c/src/core/font_renderer.js

and saw this seemingly weird code:
{code}
var glyphIndex = (code[i + 2] << 8) | code[i + 3];
i += 4;
var arg1, arg2;
if ((flags & 0x01)) {
arg1 = ((code[i] << 24) | (code[i + 1] << 16)) >> 16;
arg2 = ((code[i + 2] << 24) | (code[i + 3] << 16)) >> 16;
i += 4;
} else {
arg1 = code[i++]; arg2 = code[i++];
}
{code}
Why would they do this 16-rshift at that place and not elsewhere? To keep the 
sign.

Files that are better now:
166292-fi-ligature.pdf
FreeSansTest.pdf
gs-bugzilla693653.pdf
GWG090_Font-Support_x3.pdf
PDFBOX-1391.pdf
PDFBOX-161.pdf
PDFBOX-1735-confidential.pdf
PDFBOX-1738.pdf
PDFBOX-2059-zerowidth.pdf
PDFBOX-2251-070075.pdf
PDFBOX-2348.pdf
PDFBOX-2526.pdf
PDFBOX-705.pdf
PDFBOX-870-a_metro-vlc.pdf
PDFBOX-940.pdf
PDFBOX-958-WrycanLoremIpsumTest.pdf
source.pdf


> Umlaut not rendered correctly in TTF composite glyph
> ----------------------------------------------------
>
>                 Key: PDFBOX-1740
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1740
>             Project: PDFBox
>          Issue Type: Bug
>          Components: FontBox, Rendering
>    Affects Versions: 2.0.0
>         Environment: XP, W7
>            Reporter: Tilman Hausherr
>            Assignee: Tilman Hausherr
>             Fix For: 2.0.0
>
>         Attachments: FreeSansTestÜ.pdf, FreeSansTestÜ.pdf-1.png, Verdana.pdf, 
> verdana.pdf-1.png
>
>
> The dots above the "U" in the attached file are not rendered correctly. From 
> looking at the points array, I think that the cause is NOT the calculation of 
> the shape path itself (PDFBOX-1435), it must be before, i.e. the calculation 
> of the point coordinates that are used later for the shapes, done in 
> GlyfCompositeDescript.getXCoordinate() or even deeper.
> The X coordinates from the "U" are between 80 and 640. The X coordinates of 
> the two dots are between 406 and 587, i.e. the two dots are at the right:
> points:
> Point(547,-729,onCurve,)
> Point(640,-729,onCurve,)
> Point(640,-217,onCurve,)
> Point(640,-107,,)
> Point(487,23,,)
> Point(359,23,onCurve,)
> Point(229,23,,)
> Point(80,-106,,)
> Point(80,-217,onCurve,)
> Point(80,-729,onCurve,)
> Point(173,-729,onCurve,)
> Point(173,-217,onCurve,)
> Point(173,-138,,)
> Point(274,-59,,)
> Point(359,-59,onCurve,)
> Point(447,-59,,)
> Point(547,-143,,)
> Point(547,-217,onCurve,endOfContour)
> Point(510,-881,onCurve,)
> Point(510,-777,onCurve,)
> Point(406,-777,onCurve,)
> Point(406,-881,onCurve,endOfContour)
> Point(587,-881,onCurve,)
> Point(587,-777,onCurve,)
> Point(483,-777,onCurve,)
> Point(483,-881,onCurve,endOfContour)
> The font can be found here:
> http://ftp.gnu.org/gnu/freefont/freefont-ttf-20120503.zip



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to