You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Mehdi Houshmand (Created) (JIRA)" <ji...@apache.org> on 2012/03/09 10:48:07 UTC

[jira] [Created] (PDFBOX-1250) CFF to Type1 Font conversion is missing/corrupting the font metrics

CFF to Type1 Font conversion is missing/corrupting the font metrics
-------------------------------------------------------------------

                 Key: PDFBOX-1250
                 URL: https://issues.apache.org/jira/browse/PDFBOX-1250
             Project: PDFBox
          Issue Type: Bug
          Components: FontBox, PDModel
            Reporter: Mehdi Houshmand
            Priority: Minor


So the problem here is easily reproducible with pretty much ANY CIDFontTypeOC font file is embedded in a PDF and PDFBox is used to rasterize it, all the glyphs appear to have bad horizontal metrics.

Fontbox converts the CID encoded font into a Type1 font using the org.apache.fontbox.cff.Type1FontFormatter class and for some reason, when it does this, the horizontal metrics of the glyphs are lost/corrupted. This can clearly be seen by putting a System.out just before the byte[] type1Bytes is given to Font.createFont in PDType1CFont.java.

I've included the PDF and the Type1 font that PDFBox gives java.awt.Font, openning the font in FontForge or painting the text with Graphics2D will easily illustrate this issue.

We plan on fixing this issue in the imminent future but unfortunately, I don't make the rules...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PDFBOX-1250) CFF to Type1 Font conversion is missing/corrupting the font metrics

Posted by "Mehdi Houshmand (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PDFBOX-1250?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mehdi Houshmand updated PDFBOX-1250:
------------------------------------

    Attachment: pdfbox-type1font.pfb
                example.unc.pdf

The offending PDF and the Type1 font program that FontBox creates
                
> CFF to Type1 Font conversion is missing/corrupting the font metrics
> -------------------------------------------------------------------
>
>                 Key: PDFBOX-1250
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1250
>             Project: PDFBox
>          Issue Type: Bug
>          Components: FontBox, PDModel
>            Reporter: Mehdi Houshmand
>            Priority: Minor
>         Attachments: example.unc.pdf, pdfbox-type1font.pfb
>
>
> So the problem here is easily reproducible with pretty much ANY CIDFontTypeOC font file is embedded in a PDF and PDFBox is used to rasterize it, all the glyphs appear to have bad horizontal metrics.
> Fontbox converts the CID encoded font into a Type1 font using the org.apache.fontbox.cff.Type1FontFormatter class and for some reason, when it does this, the horizontal metrics of the glyphs are lost/corrupted. This can clearly be seen by putting a System.out just before the byte[] type1Bytes is given to Font.createFont in PDType1CFont.java.
> I've included the PDF and the Type1 font that PDFBox gives java.awt.Font, openning the font in FontForge or painting the text with Graphics2D will easily illustrate this issue.
> We plan on fixing this issue in the imminent future but unfortunately, I don't make the rules...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira