[
https://issues.apache.org/jira/browse/PDFBOX-3515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15529900#comment-15529900
]
Esteban Nicolas Ruiz commented on PDFBOX-3515:
----------------------------------------------
Thanks for your explanation. I have modified a local copy of the code for
CIDFontType0 (see attached patch) based in the fix for PDFBOX-3344 and it seems
to work. Maybe further checks are needed before casting to CFFType1Font.
> Problems with CourierStd font
> -----------------------------
>
> Key: PDFBOX-3515
> URL: https://issues.apache.org/jira/browse/PDFBOX-3515
> Project: PDFBox
> Issue Type: Bug
> Components: FontBox
> Affects Versions: 2.0.3, 2.0.4, 2.1.0
> Environment: windows
> Reporter: Esteban Nicolas Ruiz
> Attachments: fontpatch.patch, out.pdf
>
>
> Pdf file using CourierStd font doesn't display properly with PDF Debugger
> (CourierStd font not installed, using substitute font). File is properly
> displayed in Adobe Reader.
> PDF Debugger output:
> {code}
> ADVERTENCIA: Using fallback LiberationSans for CID-keyed font CourierStd
> sep 27, 2016 4:42:00 PM org.apache.pdfbox.pdmodel.font.PDType0Font toUnicode
> ADVERTENCIA: No Unicode mapping for CID+36 (36) in font CourierStd
> sep 27, 2016 4:42:00 PM org.apache.pdfbox.rendering.CIDType0Glyph2D
> getPathForCharacterCode
> ADVERTENCIA: No glyph for 36 (CID 0024) in font CourierStd
> {code}
> If I install CourierStd otf font from
> http://freeopentypefonts.com/fonts-beginning-with-c/courierstd-open-type-font-download-open-type-font
> then I get the following exception:
> {code}
> java.lang.RuntimeException: java.util.concurrent.ExecutionException:
> java.lang.ClassCastException: org.apache.fontbox.cff.CFFType1Font cannot be
> cast to org.apache.fontbox.cff.CFFCIDFont
>
> org.apache.pdfbox.debugger.pagepane.PagePane$RenderWorker.done(PagePane.java:258)
> sun.swing.AccumulativeRunnable.run(Unknown Source)
> java.security.AccessController.doPrivileged(Native Method)
>
> java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown
> Source)
> Caused by: java.util.concurrent.ExecutionException:
> java.lang.ClassCastException: org.apache.fontbox.cff.CFFType1Font cannot be
> cast to org.apache.fontbox.cff.CFFCIDFont
>
> org.apache.pdfbox.debugger.pagepane.PagePane$RenderWorker.done(PagePane.java:247)
> sun.swing.AccumulativeRunnable.run(Unknown Source)
> java.security.AccessController.doPrivileged(Native Method)
>
> java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown
> Source)
> Caused by: java.lang.ClassCastException: org.apache.fontbox.cff.CFFType1Font
> cannot be cast to org.apache.fontbox.cff.CFFCIDFont
>
> org.apache.pdfbox.pdmodel.font.PDCIDFontType0.<init>(PDCIDFontType0.java:134)
>
> org.apache.pdfbox.pdmodel.font.PDFontFactory.createDescendantFont(PDFontFactory.java:121)
> org.apache.pdfbox.pdmodel.font.PDType0Font.<init>(PDType0Font.java:128)
>
> org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:83)
> org.apache.pdfbox.pdmodel.PDResources.getFont(PDResources.java:143)
> {code}
> Maybe similar to: https://issues.apache.org/jira/browse/PDFBOX-3344
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]