New soft mask method causes some text not to be rendered
See original GitHub issueHalf of the text on this restaurant menu PDF does not render in current versions of PDF.js. I remembered that this PDF used to render correctly in Firefox, so I ran git bisect
and identified commit 2d1f9ff7a3a8e29acd7500add4a1057a5eaba191 as the change which introduced the regression.
Attach (recommended) or Link to PDF file here: Tillamook-Market-Menu-04.04.22.pdf
Configuration:
- Web browser and its version: Firefox 101.0 arm64
- Operating system and its version: macOS 12.4
- PDF.js version: git master (19539676813b5df6ca4726a1bfa6765193b1067c)
- Is a browser extension: No
Steps to reproduce the problem:
- Open the PDF.
- Observe that roughly half the text on the menu does not appear.
What is the expected behavior? (add screenshot)
What went wrong? (add screenshot)
Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension): n/a
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Soft Mask - A replacement of Unity UI Mask with alpha support
Soft Mask assumes that the mask area is planar and rectangular. In general case, there is no way to pass a description of...
Read more >text-rendering - CSS: Cascading Style Sheets - MDN Web Docs
The text-rendering CSS property provides information to the rendering engine about what to optimize for when rendering text.
Read more >Create masks - Adobe Support
The Create Masks From Text command extracts the outlines for each character, creates masks from the outlines, and puts the masks on a...
Read more >Text Rendering controls in Motion - Apple Support
The mask tools in the canvas toolbar are not available when Flatten is deselected. ... Render Text: A pop-up menu to choose a...
Read more >16xAA font rendering using coverage masks, part I
Rendering fonts should be very fast, no stalls while fonts are being rendered. Our UI has a lot of smooth animation, text should...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello! We have a 2 big customers with the same problem, please, post here any updates (@Snuffleupagus would be so much appreciated)
Having managed to create a slightly smaller test-case, see issue14982_reduced.pdf, I now understand more specifically what breaks. Although I’ve not managed to (immediately) see how to fix this, however the problem is connected to
SMask
s larger than https://github.com/mozilla/pdf.js/blob/987062c302c01bab72645e28a1ffa3fd457e1eb6/src/display/canvas.js#L49 since disabling the following code “fixes” this, and the duplicate, issue https://github.com/mozilla/pdf.js/blob/987062c302c01bab72645e28a1ffa3fd457e1eb6/src/display/canvas.js#L2665-L2672 Looking at the old code, we were previously taking thesmask.scaleX
/smask.scaleY
into account duringcomposeSMask
. Unfortunately trying to restore, a variant of, that code doesn’t work and most likely other (possibly larger) changes are required.