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

Tilman Hausherr commented on PDFBOX-3344:
-----------------------------------------

So this is the cause:
{code}
Helvetica|OTF||190|0|1|0|0|020b0500000000000000|C:\Windows\FONTS\Helvetica.otf
{code}
This code in FileSystemFontProvider
{code}
 case OTF: font = parent.getOTFFont(postScriptName, file); break;
{code}
will always return an OpenTypeFont object. Thus this code in 
FontMapperImpl.findFontBoxFont
{code}
CFFFont cff = (CFFFont)findFont(FontFormat.OTF, postScriptName);
{code}
would never work. The obvious solution would be
{code}
OpenTypeFont otf = (OpenTypeFont) findFont(FontFormat.OTF, postScriptName);
{code}
I'll test this and see what happens, LOL.

> Caused by: java.lang.ClassCastException: org.apache.fontbox.ttf.OpenTypeFont 
> can not be cast to org.apache.fontbox.cff.CFFFont
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: PDFBOX-3344
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3344
>             Project: PDFBox
>          Issue Type: Bug
>          Components: FontBox
>    Affects Versions: 2.0.1
>            Reporter: 373 mch
>         Attachments: .pdfbox.cache, etichette.pdf, helvetica.pdf
>
>
> I'm getting this error opening a specific pdf
> {noformat}
> Caused by: java.lang.ClassCastException: org.apache.fontbox.ttf.OpenTypeFont 
> can not be cast to org.apache.fontbox.cff.CFFFont
> {noformat}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to