Closed Bug 1529502 Opened 5 years ago Closed 11 months ago

Certain characters in pdfs do not display correctly

Categories

(Firefox :: PDF Viewer, defect, P1)

65 Branch
Unspecified
All
defect

Tracking

()

RESOLVED FIXED
116 Branch

People

(Reporter: Snuffleupagus, Assigned: calixte)

References

Details

(Whiteboard: [pdfjs-font-conversion])

Attachments

(2 files)

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:

  1. Go to this pdf file: https://1password.com/files/1Password%20for%20Teams%20White%20Paper.pdf

  2. 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.

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."

Priority: -- → P3
Attached file bug152488_reduced.pdf

Reduced test case.

Removing the regression flag, since we have the work around and don't need to track this across releases.

Keywords: regression

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

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

(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.

Whiteboard: [pdfjs-font-conversion]

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: bdahl → nobody
Severity: normal → S3
Assignee: nobody → cdenizet
Status: NEW → ASSIGNED
Priority: P3 → P1
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → 116 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: