PDF.js renders randomly in bold and normal fonts
Categories
(Firefox :: PDF Viewer, defect, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox87 | --- | affected |
People
(Reporter: alice0775, Unassigned)
Details
(Whiteboard: [pdfjs-rendering][pdf-d-font-windows])
Attachments
(1 file)
|
198.92 KB,
image/png
|
Details |
This is a not recent regression. I can also reproduce the problem on Firefox24.
Steps to reproduce:
- Open https://www.sanplatec.co.jp/uploads/files/chemical-resistance/pla_busseihyou.pdf
- Zoom in 170% and more
Actual results:
PDF.js renders randomly in bold and normal fonts.
See attached screenshot
Comment 1•5 years ago
|
||
This might be a platform issue. I don't see any obvious boldness on Linux.
Updated•5 years ago
|
confirming with Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:97.0) Gecko/20100101 Firefox/97.0
Updated•4 years ago
|
Comment 3•3 years ago
|
||
Alice or Kenan, are you still able to reproduce this?
| Reporter | ||
Comment 4•3 years ago
|
||
I can reproduce this on Nightly115.0a1 Windows10.
Comment 5•3 years ago
|
||
Strange, I can't reproduce the issue with the last nightly but I can with release.
This pdf doesn't embed any fonts so the rendering depends on the the OS fonts and we recently changed the way to select the fonts to use when there aren't embed.
Comment 6•3 years ago
|
||
Redirect a needinfo that is pending on an inactive user to the triage owner.
:calixte, since the bug has recent activity, could you have a look please?
For more information, please visit BugBot documentation.
Updated•3 years ago
|
Comment 7•4 months ago
|
||
The font used on my system (Windows 11) for rendering bold/unbold glyphs is MS-PGothic.
It looks a way more consistent with gfx.font_rendering.cleartype_params.rendering_mode set to 5 (DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC).
Jonathan, would it make sense to set rendering_mode to 5 when rendering a pdf (if it's something possible of course) ? Are there any possible drawbacks ?
Comment 8•4 months ago
|
||
Yes, that would probably be good -- it may result in somewhat less "crisp" rendering in some cases, but should generally be more consistent. But I'm not sure there's currently any mechanism to do this.
I guess we'd need to either provide an API that pdfjs can use to control the mode, or the graphics backend would somehow need to be able to detect that it's rendering pdfjs content.
Or we could perhaps decide that canvas2d on Windows should always use mode 5. But people might object to a mismatch between canvas2d and DOM text modes, so I'm wary of that option.
Comment 9•4 months ago
|
||
Maybe we could have something similar to the css property text-rendering but for the canvas context and when it's set to geometricPrecision we could use whatever (depending on the platform) makes the rendering "better".
Description
•