You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "John Hewson (JIRA)" <ji...@apache.org> on 2014/01/14 02:21:52 UTC

[jira] [Created] (PDFBOX-1844) [PATCH] Parser for Type 1 Fonts

John Hewson created PDFBOX-1844:
-----------------------------------

             Summary: [PATCH] Parser for Type 1 Fonts
                 Key: PDFBOX-1844
                 URL: https://issues.apache.org/jira/browse/PDFBOX-1844
             Project: PDFBox
          Issue Type: Improvement
          Components: FontBox
    Affects Versions: 2.0.0
            Reporter: John Hewson


This patch adds a parser for Type 1 fonts to FontBox and makes use of it in PDFBox for rendering Type 1 glyphs. This should fix various issues with the JVM crashing and rendering fonts incorrectly.

It was necessary to modify Type1CharStringParser to handle the `callothersubr` command and correctly handle subroutines. Likewise, Type1CharString was modified to support "flex".

This patch does not remove the AWT fallback for non-embedded and standard 14 fonts because am entirely new fallback system is needed and suitable fonts will need to be shipped as part of PDFBox. This needs to be discussed on the mailing list and/or in follow-on issue.

Note: To keep this patch small I have not replaced any of the existing ad-hoc Type 1 parsing code in PDType1Font and preflight. Those classes retain their original code which can be replaced in subsequent patches/refactoring. I can open follow-on issues for these.

~~~

As well as the patch, the these files were added:
+ /pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/font/Type1Glyph2D.java
+ /fontbox/src/main/java/org/apache/fontbox/encoding/CustomEncoding.java
+ /fontbox/src/main/java/org/apache/fontbox/type1/Token.java
+ /fontbox/src/main/java/org/apache/fontbox/type1/Type1CharStringReader.java
+ /fontbox/src/main/java/org/apache/fontbox/type1/Type1Font.java
+ /fontbox/src/main/java/org/apache/fontbox/type1/Type1Lexer.java
+ /fontbox/src/main/java/org/apache/fontbox/type1/Type1Mapping
+ /fontbox/src/main/java/org/apache/fontbox/type1/Type1Parser.java

And this file was removed:
- /pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/font/CFFGlyph2D.java




--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Re: [jira] [Created] (PDFBOX-1844) [PATCH] Parser for Type 1 Fonts

Posted by Andreas Lehmkuehler <an...@lehmi.de>.
Hi,

Am 14.01.2014 19:31, schrieb John Hewson:
> No problem, I’ve just signed the CLA and sent it to the Apache secretary.
Good to hear that and thank you!! I' monitoring  the incoming queue ....


> -- John

BR
Andreas Lehmkühler


Re: [jira] [Created] (PDFBOX-1844) [PATCH] Parser for Type 1 Fonts

Posted by John Hewson <jo...@jahewson.com>.
No problem, I’ve just signed the CLA and sent it to the Apache secretary.

-- John

On 13 Jan 2014, at 22:32, Andreas Lehmkuehler <an...@lehmi.de> wrote:

> Hi,
> 
> Am 14.01.2014 02:21, schrieb John Hewson (JIRA):
>> John Hewson created PDFBOX-1844:
>> -----------------------------------
>> 
>>              Summary: [PATCH] Parser for Type 1 Fonts
>>                  Key: PDFBOX-1844
>>                  URL: https://issues.apache.org/jira/browse/PDFBOX-1844
>>              Project: PDFBox
>>           Issue Type: Improvement
>>           Components: FontBox
>>     Affects Versions: 2.0.0
>>             Reporter: John Hewson
>> 
>> 
>> This patch adds a parser for Type 1 fonts to FontBox and makes use of it in PDFBox for rendering Type 1 glyphs. This should fix various issues with the JVM crashing and rendering fonts incorrectly.
>> 
>> It was necessary to modify Type1CharStringParser to handle the `callothersubr` command and correctly handle subroutines. Likewise, Type1CharString was modified to support "flex".
>> 
>> This patch does not remove the AWT fallback for non-embedded and standard 14 fonts because am entirely new fallback system is needed and suitable fonts will need to be shipped as part of PDFBox. This needs to be discussed on the mailing list and/or in follow-on issue.
>> 
>> Note: To keep this patch small I have not replaced any of the existing ad-hoc Type 1 parsing code in PDType1Font and preflight. Those classes retain their original code which can be replaced in subsequent patches/refactoring. I can open follow-on issues for these.
>> 
>> SNIP
> 
> This are really good news !!
> 
> And the timing is perfect as I wanted to start my own implementation this week :-)
> 
> I don't want to slow you down, but this patch is a substantial contribution and we have to ask you to sign our CLA [1]. I hope that this requirement isn't a
> showstopper here, Be sure we won't blame you if you have to decline for any
> reason. Feel free to ask if anything is unclear.
> 
> I'm going to take care about the patch as soon as the "paperwork" is done!
> 
> Thanks in advance!
> 
> BR
> Andreas Lehmkühler
> 
> [1] http://www.apache.org/licenses/#clas


Re: [jira] [Created] (PDFBOX-1844) [PATCH] Parser for Type 1 Fonts

Posted by Andreas Lehmkuehler <an...@lehmi.de>.
Hi,

Am 14.01.2014 02:21, schrieb John Hewson (JIRA):
> John Hewson created PDFBOX-1844:
> -----------------------------------
>
>               Summary: [PATCH] Parser for Type 1 Fonts
>                   Key: PDFBOX-1844
>                   URL: https://issues.apache.org/jira/browse/PDFBOX-1844
>               Project: PDFBox
>            Issue Type: Improvement
>            Components: FontBox
>      Affects Versions: 2.0.0
>              Reporter: John Hewson
>
>
> This patch adds a parser for Type 1 fonts to FontBox and makes use of it in PDFBox for rendering Type 1 glyphs. This should fix various issues with the JVM crashing and rendering fonts incorrectly.
>
> It was necessary to modify Type1CharStringParser to handle the `callothersubr` command and correctly handle subroutines. Likewise, Type1CharString was modified to support "flex".
>
> This patch does not remove the AWT fallback for non-embedded and standard 14 fonts because am entirely new fallback system is needed and suitable fonts will need to be shipped as part of PDFBox. This needs to be discussed on the mailing list and/or in follow-on issue.
>
> Note: To keep this patch small I have not replaced any of the existing ad-hoc Type 1 parsing code in PDType1Font and preflight. Those classes retain their original code which can be replaced in subsequent patches/refactoring. I can open follow-on issues for these.
>
> SNIP

This are really good news !!

And the timing is perfect as I wanted to start my own implementation this week :-)

I don't want to slow you down, but this patch is a substantial contribution and 
we have to ask you to sign our CLA [1]. I hope that this requirement isn't a
showstopper here, Be sure we won't blame you if you have to decline for any
reason. Feel free to ask if anything is unclear.

I'm going to take care about the patch as soon as the "paperwork" is done!

Thanks in advance!

BR
Andreas Lehmkühler

[1] http://www.apache.org/licenses/#clas