Certain characters in pdfs do not display correctly
Categories
(Firefox :: PDF Viewer, defect, P1)
Tracking
()
People
(Reporter: Snuffleupagus, Assigned: calixte)
References
Details
(Whiteboard: [pdfjs-font-conversion])
Attachments
(2 files)
41.65 KB,
application/pdf
|
Details | |
[mozilla/pdf.js] [OTS] Remove cntrmask instruction with no stem in charstring (bug 1529502) (#16483)
44 bytes,
text/x-github-pull-request
|
Details | Review |
See https://bugzilla.mozilla.org/show_bug.cgi?id=1524888#c14, and for what it's worth I don't agree with closing than one when the underlying font conversion bug still isn't fixed.
+++ This bug was initially created as a clone of Bug #1524888 +++
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:65.0) Gecko/20100101 Firefox/65.0
Steps to reproduce:
-
Go to this pdf file: https://1password.com/files/1Password%20for%20Teams%20White%20Paper.pdf
-
The first occurence of this issue appears on page 10.
Actual results:
The character is displayed incorrectly. See the attached screenshot.
Expected results:
The characters "18000" should be displayed.
Comment 1•6 years ago
|
||
Notes for when I (or someone else) get time to look into this:
The font "VENLVK+FiraMath-Regular" fail to run through the open type sanitizer:
ERROR at ../src/cff_type2_charstring.cc:388 (ExecuteType2CharStringOperator)
ERROR at ../src/cff_type2_charstring.cc:793 (ExecuteType2CharString)
ERROR at ../src/cff_type2_charstring.cc:901 (ValidateType2CharStringIndex)
ERROR: CFF : Failed validating charstring set 0
ERROR at ../src/ots.cc:698 (ProcessGeneric)
ERROR: CFF : Failed to parse table
Failed to sanitize file!
The charstring 24 (or 25 in pdf.js) is the glyph that fails because it starts with:
"71 cntrmask" and appears to have no stem hints before that.
From the spec:
"The hint operators cntrmask and/or hintmask must not occur if the charstring has no stem hints."
Comment 2•6 years ago
|
||
Reduced test case.
Comment 3•6 years ago
|
||
Removing the regression flag, since we have the work around and don't need to track this across releases.
Works for me / it was fixed 2019-02-13 to 2019-02-14 (mozregression)
The test case looks identically on FF (nightly) and Adobe Acrobat
FF with Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:97.0) Gecko/20100101 Firefox/97.0
but console shows:
Warning: Failed to load font 'g_d0_f2': 'SyntaxError: An invalid or illegal string was specified'. pdf.js:925:13
downloadable font: CFF : Failed validating CharStrings INDEX (font-family: "g_d0_f2" style:normal weight:400 stretch:100 src index:0) source: (invalid URI)
downloadable font: CFF : Failed to parse table (font-family: "g_d0_f2" style:normal weight:400 stretch:100 src index:0) source: (invalid URI)
downloadable font: rejected by sanitizer (font-family: "g_d0_f2" style:normal weight:400 stretch:100 src index:0) source: (invalid URI)
downloadable font: font load failed (font-family: "g_d0_f2" style:normal weight:400 stretch:100 src index:0) source: (invalid URI)
mozregression:
app_name: firefox
build_date: 2019-02-15
build_url: https://archive.mozilla.org/pub/firefox/nightly/2019/02/2019-02-15-18-40-35-mozilla-central/firefox-67.0a1.en-US.win64.zip
changeset: 8961019ee4c6fe27e6319d9cf9ea6867b4f3c7bb
pushlog_url: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=08f794a4928eed47fe7a0f9a0c818b8f2a7fa11a&tochange=8961019ee4c6fe27e6319d9cf9ea6867b4f3c7bb
repo_name: mozilla-central
repo_url: https://hg.mozilla.org/mozilla-central
Comment 5•3 years ago
|
||
Bug 1527714 is in that range, and one change looks relevant:
#10539 [api-minor] Fallback to the built-in font renderer when font loading fails
Reporter | ||
Comment 6•3 years ago
|
||
(In reply to Kenan from comment #4)
but console shows:
Warning: Failed to load font 'g_d0_f2': 'SyntaxError: An invalid or illegal string was specified'. pdf.js:925:13
downloadable font: CFF : Failed validating CharStrings INDEX (font-family: "g_d0_f2" style:normal weight:400 stretch:100 src index:0) source: (invalid URI)
downloadable font: CFF : Failed to parse table (font-family: "g_d0_f2" style:normal weight:400 stretch:100 src index:0) source: (invalid URI)
downloadable font: rejected by sanitizer (font-family: "g_d0_f2" style:normal weight:400 stretch:100 src index:0) source: (invalid URI)
downloadable font: font load failed (font-family: "g_d0_f2" style:normal weight:400 stretch:100 src index:0) source: (invalid URI)
This bug was opened specifically to fix the underlying font conversion bug, which is still present (according to the quote above).
Yes, a work-around exists; but it'd still be a good idea to fix the actual bug here such that the font isn't rejected by OTS.
Assignee | ||
Updated•3 years ago
|
Comment 7•3 years ago
|
||
The bug assignee is inactive on Bugzilla, so the assignee is being reset.
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Comment 8•2 years ago
|
||
Updated•2 years ago
|
Description
•