You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Steve Poling (JIRA)" <ji...@apache.org> on 2009/07/07 06:28:14 UTC

[jira] Created: (PDFBOX-490) Pdf Printing of text from embedded fonts

Pdf Printing of text from embedded fonts
----------------------------------------

                 Key: PDFBOX-490
                 URL: https://issues.apache.org/jira/browse/PDFBOX-490
             Project: PDFBox
          Issue Type: Bug
          Components: Utilities
    Affects Versions: 0.8.0-incubator
         Environment: Windows XP, JRE 1.6
            Reporter: Steve Poling


When printing from utility PrintPdf, text is rendered in the wrong typeface. The correct typeface is embedded within the PDF (Embedded Subset) as a TrueType font with an ANSI encoding. It may be noted that the AcroFields in a Courier typeface render correctly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (PDFBOX-490) Pdf Printing of text from embedded fonts

Posted by "Andreas Lehmkühler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PDFBOX-490?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Lehmkühler reassigned PDFBOX-490:
-----------------------------------------

    Assignee: Andreas Lehmkühler

> Pdf Printing of text from embedded fonts
> ----------------------------------------
>
>                 Key: PDFBOX-490
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-490
>             Project: PDFBox
>          Issue Type: Bug
>          Components: FontBox
>    Affects Versions: 0.8.0-incubator
>         Environment: Windows XP, JRE 1.6
>            Reporter: Steve Poling
>            Assignee: Andreas Lehmkühler
>         Attachments: filled.pdf
>
>
> When printing from utility PrintPdf, text is rendered in the wrong typeface. The correct typeface is embedded within the PDF (Embedded Subset) as a TrueType font with an ANSI encoding. It may be noted that the AcroFields in a Courier typeface render correctly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PDFBOX-490) Pdf Printing of text from embedded fonts

Posted by "Andreas Lehmkühler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PDFBOX-490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12735951#action_12735951 ] 

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

I've to correct my former guess. First off all the problem is the missing Naming-Table.

I think there are two possible options to solve this issue. In both cases we have to improve the TTFParser.

(1) repair the incomplete stream before passing it to the createFont method
(2) create an awtfont on our own with the provided data from the embedded fontdata

I guess (1) will be easier. Any other ideas?

> Pdf Printing of text from embedded fonts
> ----------------------------------------
>
>                 Key: PDFBOX-490
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-490
>             Project: PDFBox
>          Issue Type: Bug
>          Components: FontBox
>    Affects Versions: 0.8.0-incubator
>         Environment: Windows XP, JRE 1.6
>            Reporter: Steve Poling
>         Attachments: filled.pdf
>
>
> When printing from utility PrintPdf, text is rendered in the wrong typeface. The correct typeface is embedded within the PDF (Embedded Subset) as a TrueType font with an ANSI encoding. It may be noted that the AcroFields in a Courier typeface render correctly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PDFBOX-490) Pdf Printing of text from embedded fonts

Posted by "Andreas Lehmkühler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PDFBOX-490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12796560#action_12796560 ] 

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

The java font loader complains about the missing name table, so that I tried to add that one. To do so, we have to implement a TTF writer. There are already some classes [1] from the TTFParser which can be used.


[1] http://svn.eu.apache.org/viewvc/pdfbox/fontbox/trunk/src/main/java/org/apache/fontbox/ttf/

> Pdf Printing of text from embedded fonts
> ----------------------------------------
>
>                 Key: PDFBOX-490
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-490
>             Project: PDFBox
>          Issue Type: Bug
>          Components: FontBox
>    Affects Versions: 0.8.0-incubator
>         Environment: Windows XP, JRE 1.6
>            Reporter: Steve Poling
>            Assignee: Andreas Lehmkühler
>         Attachments: filled.pdf
>
>
> When printing from utility PrintPdf, text is rendered in the wrong typeface. The correct typeface is embedded within the PDF (Embedded Subset) as a TrueType font with an ANSI encoding. It may be noted that the AcroFields in a Courier typeface render correctly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PDFBOX-490) Pdf Printing of text from embedded fonts

Posted by "Andreas Lehmkühler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PDFBOX-490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12792380#action_12792380 ] 

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

I've worked on option (1) but it's more complicated than I thought at first. At the moment I'm working on PDFBOX-542 which will add support for CFF/Type2 fonts to fontbox. As java doesn't support that font format, those fonts will be converted to a Type1 font which is supported by java. Returning to our issue with embedded subsets of true type fonts, this will be a suitable solution too.

> Pdf Printing of text from embedded fonts
> ----------------------------------------
>
>                 Key: PDFBOX-490
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-490
>             Project: PDFBox
>          Issue Type: Bug
>          Components: FontBox
>    Affects Versions: 0.8.0-incubator
>         Environment: Windows XP, JRE 1.6
>            Reporter: Steve Poling
>            Assignee: Andreas Lehmkühler
>         Attachments: filled.pdf
>
>
> When printing from utility PrintPdf, text is rendered in the wrong typeface. The correct typeface is embedded within the PDF (Embedded Subset) as a TrueType font with an ANSI encoding. It may be noted that the AcroFields in a Courier typeface render correctly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PDFBOX-490) Pdf Printing of text from embedded fonts

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

Steve Poling updated PDFBOX-490:
--------------------------------

    Attachment: filled.pdf

This file illustrates the problem. Please let me know if attaching the TTF files used to generate this PDF would prove helpful.

> Pdf Printing of text from embedded fonts
> ----------------------------------------
>
>                 Key: PDFBOX-490
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-490
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 0.8.0-incubator
>         Environment: Windows XP, JRE 1.6
>            Reporter: Steve Poling
>         Attachments: filled.pdf
>
>
> When printing from utility PrintPdf, text is rendered in the wrong typeface. The correct typeface is embedded within the PDF (Embedded Subset) as a TrueType font with an ANSI encoding. It may be noted that the AcroFields in a Courier typeface render correctly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PDFBOX-490) Pdf Printing of text from embedded fonts

Posted by "Steve Poling (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PDFBOX-490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12796548#action_12796548 ] 

Steve Poling commented on PDFBOX-490:
-------------------------------------

I just took inventory of the tables used in the TTF data embedded in the PDF attached to PDFBOX-490 and compared it with the TTF file from which the data originated. I found that the following tables are omitted: hdmx (horizonal device metrics), name, and post (glyph name and postscript compatibility).

Have you attempted adding any of these tables to the TTF stream? I suppose the easiest would be the name table, then post, then hdmx. I note the TTF documentation requires the name and post tables, but not the hdmx, so I suppose I might get by without that.

Is there anything in the pdfbox codebase that reads/writes TTF files?

> Pdf Printing of text from embedded fonts
> ----------------------------------------
>
>                 Key: PDFBOX-490
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-490
>             Project: PDFBox
>          Issue Type: Bug
>          Components: FontBox
>    Affects Versions: 0.8.0-incubator
>         Environment: Windows XP, JRE 1.6
>            Reporter: Steve Poling
>            Assignee: Andreas Lehmkühler
>         Attachments: filled.pdf
>
>
> When printing from utility PrintPdf, text is rendered in the wrong typeface. The correct typeface is embedded within the PDF (Embedded Subset) as a TrueType font with an ANSI encoding. It may be noted that the AcroFields in a Courier typeface render correctly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PDFBOX-490) Pdf Printing of text from embedded fonts

Posted by "Andreas Lehmkühler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PDFBOX-490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12728170#action_12728170 ] 

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

I guess the streams for the fonts (embedded subset) aren't complete. The PostScriptTable is missing and obviously java needs it to create an awt-font from a truetype-font (see java.awt.Font.createFont). otherwise a FontFormatException is thrown.

Does anyone know a workaround? Or do we have to implement a ttf-streamwriter to create a repaired ttf-stream?

> Pdf Printing of text from embedded fonts
> ----------------------------------------
>
>                 Key: PDFBOX-490
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-490
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 0.8.0-incubator
>         Environment: Windows XP, JRE 1.6
>            Reporter: Steve Poling
>         Attachments: filled.pdf
>
>
> When printing from utility PrintPdf, text is rendered in the wrong typeface. The correct typeface is embedded within the PDF (Embedded Subset) as a TrueType font with an ANSI encoding. It may be noted that the AcroFields in a Courier typeface render correctly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PDFBOX-490) Pdf Printing of text from embedded fonts

Posted by "Andreas Lehmkühler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PDFBOX-490?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Lehmkühler updated PDFBOX-490:
--------------------------------------

    Component/s:     (was: Utilities)
                 FontBox

> Pdf Printing of text from embedded fonts
> ----------------------------------------
>
>                 Key: PDFBOX-490
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-490
>             Project: PDFBox
>          Issue Type: Bug
>          Components: FontBox
>    Affects Versions: 0.8.0-incubator
>         Environment: Windows XP, JRE 1.6
>            Reporter: Steve Poling
>         Attachments: filled.pdf
>
>
> When printing from utility PrintPdf, text is rendered in the wrong typeface. The correct typeface is embedded within the PDF (Embedded Subset) as a TrueType font with an ANSI encoding. It may be noted that the AcroFields in a Courier typeface render correctly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.