You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2014/06/13 22:35:02 UTC

[jira] [Commented] (PDFBOX-2141) Shading not applied to text

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

Tilman Hausherr commented on PDFBOX-2141:
-----------------------------------------

Obviously, it is a ligature problem. I thought that a ligature is ONE glyph but at least in that code segment, it is not (although it is in the PDF source). For "fi", glyphs.getNumGlyphs() == 2.

This is of course not a solution, but if I use "the old method" for glyphs.getNumGlyphs() > 1 and "your method" for glyphs.getNumGlyphs() == 1 then I get a perfect rendering for over 100 test PDFs. (Except some very minor differences that may be the result of rounding)

Could it be that if there is some relationship between the glyph entries, i.e. that the transform can't be applied to the 2nd glyph of the ligature in the same way as to the 1st?

> Shading not applied to text
> ---------------------------
>
>                 Key: PDFBOX-2141
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2141
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Rendering
>    Affects Versions: 2.0.0
>            Reporter: Petr Slaby
>            Priority: Minor
>         Attachments: 000004_ShadingPatternTextPDF.pdf, PDFBOX-1917.pdf-1.png, PDFBOX-1917.pdf-1.png-diff.png, PDFBOX-1917.pdf-9.png, PDFBOX-1917.pdf-9.png-diff.png, PDFBOX-2135.pdf-2.png, PDFBOX-2135.pdf-2.png-diff.png, PageDrawer.writeFont.java.patch
>
>
> The attached PDF draws a text filled with horizontal shading going from red to blue. When rendered via PDFBox, the text is completely filled with red. The problem is that AxialShadingContext#getRaster() gets called with positions that completely fell outside of the range stored in its coords[] field. The fix seems to be to set glyph transform rather than graphics2d transform in PageDrawer#writeText() as shown in the attached patch.



--
This message was sent by Atlassian JIRA
(v6.2#6252)