Some chars are rendered incorrectly in some documents
Categories
(Firefox :: PDF Viewer, defect, P1)
Tracking
()
People
(Reporter: michel, Assigned: calixte)
References
Details
Attachments
(5 files)
Hello,
I noticed that the PDF Viewer renders some chars in some documents incorrectly. Please see the attached screenshots. The :
in the URL in the footer is rendered differently in Firefox PDF Viewer than in Evince.
Document source: https://cert.pl/uploads/2022/01/hasla/resources/plakaty_informacyjne_hasla_a4.pdf
Reporter | ||
Comment 1•3 years ago
|
||
Reporter | ||
Comment 2•3 years ago
|
||
Reporter | ||
Updated•3 years ago
|
Comment 3•3 years ago
|
||
This isn't the "normal" kind of font conversion bug, since it's connected to the specific text rendering mode being used (in this case 7
); please see https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf#G8.1772271
Hence the bug would, most likely, be found in https://github.com/mozilla/pdf.js/blob/master/src/core/font_renderer.js
Assignee | ||
Comment 4•3 years ago
|
||
:Snuffleupagus, thanks for the tip :).
So I looked in font_renderer.js
what could be wrong and I think I found.
The :
is a composite glyph (two .
) and there is something wrong here:
https://github.com/mozilla/pdf.js/blob/236c8d47864e8ebf593bae21576670b59a7d4988/src/core/font_renderer.js#L202
If I understand correctly, if flags & 0x01
then we get two int16 else we get two uint8.
But according to the specs:
https://docs.microsoft.com/en-us/typography/opentype/spec/glyf
if flags & 0x02
(i.e. ARGS_ARE_XY_VALUES) then these two numbers must be treated as signed.
So I just handled the uint8 => int8 case and it works.
I think we could fix this TODO too:
https://github.com/mozilla/pdf.js/blob/236c8d47864e8ebf593bae21576670b59a7d4988/src/core/font_renderer.js#L214
:Snuffleupagus, if you began to work on a fix, feel free to take the bug.
Assignee | ||
Updated•3 years ago
|
Comment 5•3 years ago
|
||
Comment 6•3 years ago
|
||
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Comment 7•3 years ago
|
||
Reproduced with 2022-01-11-09-38-27 build of Nightly.
Issue is no longer reproducible on 98.0b8 beta if Firefox.
Description
•