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

John Hewson commented on PDFBOX-2526:
-------------------------------------

The problem is that "Arial-Black" is the name of the font in the TTF file, and 
we can't map backwards from the name "ArialBlack" in the PDF to know where to 
insert the hyphens. Because this isn't a standard 14 / built-in font, we don't 
really want to add a manual substitution, because it won't solve the problem in 
general for other fonts.

To solve this, I've modified the FontProvider to perform "reverse 
substitution", because only the FontProvider is in a position to know that the 
font on disk is called "Arial-Black" and can simply remove the comma to get the 
name "ArialBlack" which was specified in the PDF. Note that we aim to keep as 
much substitution logic as possible away from the font provider, but this logic 
must live within the provider. I've encapsulated made FontProvider an abstract 
class and placed the logic inside final protected methods so that subclasses 
have easy access to the reverse substitutions but the can't mess with the logic.

> Arial black not black
> ---------------------
>
>                 Key: PDFBOX-2526
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2526
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Rendering
>    Affects Versions: 2.0.0
>            Reporter: simon steiner
>         Attachments: sample_fonts_solidconvertor.pdf
>
>
> java -jar ~/pdf-box-svn/app/target/pdfbox-app-2.0.0-SNAPSHOT.jar PDFToImage 
> sample_fonts_solidconvertor.pdf



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

Reply via email to