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/10/25 10:39:32 UTC

[jira] [Commented] (PDFBOX-1741) [PATCH] Text should be in italic but is rendered upright

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

Andreas Lehmkühler commented on PDFBOX-1741:
--------------------------------------------

I agree with Vincent, the fontmatrix isn't used properly. Until now only the scaling is used as I never saw something like this sample. It uses a "regular" font which is made italic by using a font matrix with some shearing effect.

But your patch is somehow problematic. I like your idea to simplify the adjustment of the y-coordinate, but your patch would simply remove some of needed code which would break the rendering of a lot of pdfs. e.g. 
- the changes in "Invoke" will lead to wrong scaled images, see PDFBOX-758
- the changes in "TTFGlyph2d" eliminate the transformation from font units to display units (in most cases the factor is 1000 but not always, I have a sample PDF somewhere, but didn't find it yet)

I'm going to fix the fontmatrix usage and I'll try to simply some of the code based on the proposed changes.

So far, thanks for the contribution. :-)

> [PATCH] Text should be in italic but is rendered upright
> --------------------------------------------------------
>
>                 Key: PDFBOX-1741
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1741
>             Project: PDFBox
>          Issue Type: Bug
>            Reporter: Vincent Hennebert
>         Attachments: FontMatrix.patch, image.pdf
>
>
> See attached PDF. The embedded font has a FontMatrix with skew values to make the font look italic. It's not taken into account by PDFBox.
> In PageDrawer and CFFGlyph2D there are a lot of manual modifications of the y coordinate to convert from the PDF coordinate system to AWT. This can be avoided by applying an initial transform to the Graphics2D instance. That allows to simplify the code quite a bit.



--
This message was sent by Atlassian JIRA
(v6.1#6144)