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

John Hewson commented on PDFBOX-2380:
-------------------------------------

I've refactored the way that glyph lists are loaded in 2.0, we now parse the 
standard .txt files rather than .properties files, and I've included copies of 
Adobe's AGL and Zapf Dingbats glyph lists.

I've also fixed some bugs related to use of Java's char which meant that the 
glyph lists couldn't store mappings outside of the BMP. I've also accounted for 
the fact that the Adobe glyph lists contain some multi-character mappings.

I've replaced the static DEFAULT glyph list with a getAdobeGlyphList() method, 
as some PDFBox font internals require this to be the AGL and not some other 
additional glyph list. The loading and use of the additional glyphlist is 
application specific and so has been moved to PDFStreamEngine, where the 
getGlyphList() method can be overridden to pass custom glyph lists to fonts. 
PDFTextStreamEngine does this with the additional glyph list which is currently 
shipped with PDFBox for use in Unicode mapping.

> Glyphlist .properties are not ordered
> -------------------------------------
>
>                 Key: PDFBOX-2380
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2380
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: John Hewson
>            Assignee: John Hewson
>
> Currently we use .properties files to load the glyph lists, however Java's 
> Properties is not ordered (the properties are stored in a Hashtable) and so 
> the glyphs are not read in the correct order.
> This results in incorrect encoding when calling GlyphList.unicodeToName(), 
> because the Adobe glyph lists are ordered: the default mapping comes first, 
> and auxiliary mappings follow it, for example:
> {code}
> space=0020
> spacehackarabic=0020
> {code}
> Currently in PDFBox, GlyphList.unicodeToName(0x20) returns "spacehackarabic", 
> which is wrong, we always want the first entry in the glyph list.
> We need to move away from using .properties and instead just use Adobe's 
> existing glyph list format, the only difference is that we switch {{=}} for 
> {{;}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to