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

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

I just tried a "desperate late night attempt", to assign /Fontfile2 to 
/FontFile3 in PDCIDFontType2
{code}
            if (ff2Stream != null && ff3Stream == null)
            {
                InputStream is = ff2Stream.createInputStream();
                if (is.read() == 'O' && is.read() == 'T' && is.read() == 'T' && 
is.read() == 'O')
                {
                    LOG.warn("/FontFile2 contains openType font, treating as 
/FontFile3");
                    ff3Stream = ff2Stream;
                    ff2Stream = null;
                }
                is.close();                
            }
{code}
but this didn't help either, because the otf parser is really just a ttf 
parser, and brings the same 'loca' error.

> 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, fontfile2.ttf, 
> helvetica.pdf, screenshot_1.png, screenshot_2_pdfdebugger.png, 
> screenshot_3_chrome.png, screenshot_4_acrobat.png
>
>
> 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