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

Eric Leleu commented on PDFBOX-704:
-----------------------------------

Hi,


" What exactly is the purpose of the CMap/CMapParser changes?"

These changes grant the access to CMap properties like the WMode or the 
CMapName.
In some cases, it is useful to check that these properties are equals to 
properties defined in the Font Dictionary declared in the PDF file.

"Why is the TTFParser a subclass of the CIDFontType2Parser, shouldn't it by 
vice versa?"

You are right, I made the TTFParser as a subclass  of the CIDFontType2Parser 
because of the CMap entry which is useless in the CIDFont. So only the 
TTFParser.parseTables method has to check it, except this point the parsing is 
the same. 
It may be better to make the CIDFontType2Parser as subclass of the TTFParser 
and use some simple methods to check each entry (CMap, HorizontalHeader...). 
These methods will be called by the parseTables method of the AbtractTTFParser, 
when a subclass must have a specific behaviour the method will be overrided.  
In the case of the CMap, TTFParser check it is not null and the 
CIDFontType2Parser does nothing or throw an exception if the CMap is present...

What is your opinion?

Regards,
Eric

> Implementation of additional CMAP Formats for TrueType fonts
> ------------------------------------------------------------
>
>                 Key: PDFBOX-704
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-704
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: FontBox
>    Affects Versions: 1.0.0, 1.1.0
>            Reporter: Eric Leleu
>            Priority: Minor
>         Attachments: CMapFormat.patch, fontbox.patch
>
>
> Hi, 
> According to the Apple's "TrueType Reference Manual" and the Microsoft's 
> "TrueType 1.0 Font Files Technical Specification", there are several CMap 
> formats.
> Currently FontBox implements formats 0, 4 and 6.
> In attachment you can find a patch which implements formats 2, 8, 10, 12 and 
> 13 according to my understanding of the following links : 
> http://www.microsoft.com/typography/otspec/cmap.htm (OpenType Specification)
> http://developer.apple.com/fonts/TTRefMan/RM06/Chap6cmap.html
> This patch includes changes proposal of the JIRA Issues :
> PDFBOX-668, PDFBOX-670, PDFBOX-691 
> I hope this patch will help you.
> Regards,
> Eric

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

Reply via email to