ncode.syosetu.com - Opening a PDF in Firefox shows Japanese vertical punctuation errors
Categories
(Firefox :: PDF Viewer, defect, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox130 | --- | fixed |
People
(Reporter: rbucata, Assigned: calixte)
References
()
Details
(Keywords: webcompat:needs-diagnosis, webcompat:site-report)
User Story
platform:windows,mac,linux,android impact:significant-visual configuration:general affects:all
Attachments
(2 files)
Environment:
Operating system: All Desktop
Firefox version: Firefox 127.0/Firefox 129.0a1
Steps to reproduce:
- Open a downloaded PDF file from the site (provided in attachment)
- Observe the Japanese punctuation
Expected Behavior:
Japanese punctuation is rendered as expected
Actual Behavior:
Items are misaligned
Notes:
- Reproduces regardless of the status of ETP
- Reproduces in Firefox Nightly, Firefox Release
- Does not reproduce in Chrome
Created from https://github.com/webcompat/web-bugs/issues/138659
Reporter | ||
Comment 1•4 months ago
|
||
Reporter | ||
Updated•4 months ago
|
Comment 2•4 months ago
|
||
This seems like a pdf.js bug.
Assignee | ||
Comment 3•4 months ago
|
||
The brackets on page 2 are encoded in utf-16 in the pdf and their codes are 0x3010 and 0x3011 and according to:
https://www.compart.com/en/unicode/block/U+3000
they seem to be some chars for the horizontal mode since their counter parts in vertical mode exist (see https://www.compart.com/en/unicode/block/U+FE30), that said my skills in Japanese are close to null
.
In either Chrome or Acrobat, they're rendered correctly so it means we should detect the text orientation before drawing on the canvas and switch chars from horizontal mode to vertical if it's required.
Assignee | ||
Comment 4•4 months ago
|
||
The used (and missing) font is vertical so in using the mapping:
https://searchfox.org/mozilla-central/rev/cbdfa503a87597b20719aae5f6a1efccd6cb3b7b/gfx/thebes/gfxHarfBuzzShaper.cpp#251-294
we should be able to remap correctly the chars when the font isn't embedded.
Assignee | ||
Updated•4 months ago
|
Comment 5•4 months ago
|
||
Comment 7•4 months ago
|
||
We are pleased to see that bug 1695816, which had not been considered at the time of our report on PDF files published by Japanese ministries, is on its way to being fixed by this bug.
The table you quoted from gfx/thebes/gfxHarfBuzzShaper.cpp was added in bug 1164835.
However, this table does not fully support the section 5 of UTR #50 (Glyphs Changes for Vertical Orientation).
I am not sure what criteria was used to select the characters to create this table.
We look forward to a more complete implementation of UTR #50 Section 5 to correct this error.
bug 1906308 is filed as a related.
Assignee | ||
Comment 8•4 months ago
•
|
||
As far as I can tell this table just contains a mapping for the chars having a unicode in both forms (i.e. horizontal or vertical).
For example \u301C (wave dash) isn't the harfbuzz table because it doesn't have a vertical counterpart in unicode (see https://en.wikipedia.org/wiki/Wave_dash).
As reported in https://github.com/mozilla/pdf.js/issues/18384, there are some other issues I'll try to address asap.
That said, the best thing to do is to embed the fonts in the pdf and use them correctly to have the right form for each glyph.
In the pdf specs it's said that it could have some rendering issues in case the fonts aren't embedded... we're in this case.
Updated•4 months ago
|
Description
•