New issue
Advanced search Search tips

Issue 666566 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner:
Closed: Nov 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

"Failed to decode downloaded font" for particular otf font

Reported by mpariz...@pdftron.com, Nov 18 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36

Steps to reproduce the problem:
1. Load index.html page
2. See that the letter M is in a default font and there are errors in the console
"Failed to decode downloaded font: 0.otf
OTS parsing error: CFF: Failed validating charstring set 0"

What is the expected behavior?
Font loads correctly as in IE11 and Edge.

What went wrong?
This font only defines the capital letter M but it is quite complicated so the problem is likely related to that. If there is actually something wrong with the font it would be nice to know as well so that we can correct it.

Did this work before? N/A 

Does this work in other browsers? No
 It works as expected in IE and Edge but fails in Firefox. This bug in Firefox seems related https://bugzilla.mozilla.org/show_bug.cgi?id=1252420

Chrome version: 54.0.2840.99  Channel: stable
OS Version: 10.0
Flash Version: Shockwave Flash 23.0 r0
 
index.html
206 bytes View Download
0.otf
81.0 KB Download
Labels: -OS-Windows OS-All
Owner: ksakamoto@chromium.org
Status: WontFix (was: Unconfirmed)
Here's the output from debug build of OTS (OpenType sanitiser):

$ ./ot-sanitise 0.otf 
ERROR at src/cff_type2_charstring.cc:866 (ValidateType2CharStringIndex)
ERROR at src/cff.cc:1012 (ots_cff_parse)
ERROR: CFF: Failed validating charstring set 0
ERROR at src/ots.cc:670 (ProcessGeneric)
Failed to sanitise file!

The font was rejected here, because charstring length was greater than kMaxCharStringLength:
https://github.com/khaledhosny/ots/blob/master/src/cff_type2_charstring.cc#L865

kMaxCharStringLength is 65535. The comment says that this is defined in Adobe Technical Note #5177.
https://github.com/khaledhosny/ots/blob/master/src/cff_type2_charstring.cc#L21


So, it seems that the font is too complex and exceeded the maximum data length allowed by the spec.

Sign in to add a comment