Emoji not showing after printing to PDF
Categories
(Core :: Printing: Output, defect)
Tracking
()
People
(Reporter: jamesgillard, Assigned: jfkthame)
References
(Regressed 1 open bug, Regression)
Details
(Keywords: regression)
Attachments
(5 files)
(deleted),
text/html
|
Details | |
(deleted),
image/png
|
Details | |
(deleted),
application/pdf
|
Details | |
(deleted),
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
RyanVM
:
approval-mozilla-esr91+
|
Details |
(deleted),
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
RyanVM
:
approval-mozilla-esr91+
|
Details |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36
Steps to reproduce:
I can reproduce by following these steps:
- Open the attached HTML file.
- Save to PDF.
- View the PDF in a PDF viewer.
I'm on MacOs Big Sur 11.5.1.
Tested working in 89.0.2.
Tested not working in 90.0.2 latest stable.
Tested not working in 91.0b9 beta.
Tested not working in 92.0a1 nightly.
Actual results:
The emoji is visible on the print preview screen.
The emoji is not visible when I view the saved PDF.
When I drag the cursor over where the emoji should be, it gets selected/outlined, and then right clicking on the selected area shows the emoji is in fact there, but I can't see it. Here's a screenshot of what this looks like to me. Firefox on the left, PDF on the right:
https://i.ibb.co/ZLLZ1Fh/Screenshot-2021-08-03-at-17-40-13.png
Expected results:
The emoji is visible on the print preview screen.
The emoji is visible when I view the saved PDF.
Reporter | ||
Comment 1•3 years ago
|
||
Here's the screenshot showing Firefox on the left showing the HTML file, and MacOS Preview on the right showing the printed PDF, with the invisible but present emoji character.
Comment 2•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Printing: Output' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Reporter | ||
Comment 3•3 years ago
|
||
Here's an example printed PDF that has the issue.
Comment 4•3 years ago
|
||
Thanks for reporting! jamesgillard, would you mind narrowing down which bug caused this issue by using https://mozilla.github.io/mozregression/?
Note that I can't reproduce the issue on my Linux box.
Updated•3 years ago
|
Reporter | ||
Comment 5•3 years ago
|
||
From mozregression:
2021-08-04T09:44:30.250000: DEBUG : Found commit message:
Bug 739096 - Don't leave the shm field uninitialized in cairo_xlib_display. r=jrmuizel
This resulted in a valgrind failure on autoland.
Submitted upstream at https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/170.
Differential Revision: https://phabricator.services.mozilla.com/D113756
2021-08-04T09:44:30.250000: DEBUG : Did not find a branch, checking all integration branches
2021-08-04T09:44:30.262000: INFO : The bisection is done.
Comment 6•3 years ago
|
||
Great, thanks!
Updated•3 years ago
|
Assignee | ||
Comment 7•3 years ago
|
||
Interesting - the generated PDF supposedly includes (a one-character subset of) the Apple Color Emoji font, so it's trying to do the right thing, but I guess it's failing to include the actual color-bitmap table or something like that.
Looking more carefully at the behavior in Firefox 89, it wasn't actually correct there either: the emoji glyph is rendered somewhat too large in the PDF. This is more obvious if you modify the testcase to have multiple emojis, as the error accumulates. So saving something like
x💛💛💛💛💛💛💛💛💛💛x
shows a clear visual error when viewing the resulting PDF.
It looks like it's actually painting the glyphs as images in the PDF, overlaid with text content that renders blank (because the embedded "Apple Color Emoji" font just contains a blank glyph) but makes it possible to search/copy/etc the text.
Comment 8•3 years ago
|
||
Set release status flags based on info from the regressing bug 739096
Updated•3 years ago
|
Assignee | ||
Comment 9•3 years ago
|
||
So this is basically https://gitlab.freedesktop.org/cairo/cairo/-/issues/54.
We added support for this in bug 715798, but although some Core Text APIs have been adopted upstream, not all of this work has been merged there and so the cairo update regressed it.
I was going to re-do this manually, but then found that Andrea Canciani has a branch at https://gitlab.freedesktop.org/ranma42/cairo/-/commits/quartz-colored-glyphs that has the necessary patches, and these apply successfully to the code we have in the tree. So to minimize the risk of overlooking something, I'm pulling those commits instead of recreating the changes by hand.
I believe the resulting behavior still suffers from rendering Apple Color Emoji glyphs slightly oversized, but that's the same as was happening before the cairo update. (It looks a lot like what we were seeing in bug 804934, although a macOS update appeared to resolve that.) Anyhow, I don't think that should block taking the fix here, which at least restores the pre-bug 739096 rendering.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 10•3 years ago
|
||
Updated•3 years ago
|
Assignee | ||
Comment 11•3 years ago
|
||
Assignee | ||
Comment 12•3 years ago
|
||
Given the scale of the patch here, I'm inclined to hold this until after the Fx92 soft-freeze, and then request beta uplift once it is safely on Nightly93.
Needinfo-ing myself as a reminder to land this next week.
Comment 13•3 years ago
|
||
Comment 15•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1e2706a53da8
https://hg.mozilla.org/mozilla-central/rev/bbdde1587188
Assignee | ||
Comment 17•3 years ago
|
||
Comment on attachment 9234960 [details]
Bug 1723787 - Apply cairo quartz font/surface changes from Andrea Canciani's quartz-colored-glyphs branch at https://gitlab.freedesktop.org/ranma42/cairo/-/commits/quartz-colored-glyphs. r?jrmuizel
Beta/Release Uplift Approval Request
- User impact if declined: Emoji fail to appear in PDF output on macOS
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Merging changes from an upstream branch that has been around quite a while (and is based on what we used to have in Gecko's old forked cairo), so it's pretty well tested/reviewed code.
- String changes made/needed:
Assignee | ||
Updated•3 years ago
|
Comment 18•3 years ago
|
||
Comment on attachment 9234960 [details]
Bug 1723787 - Apply cairo quartz font/surface changes from Andrea Canciani's quartz-colored-glyphs branch at https://gitlab.freedesktop.org/ranma42/cairo/-/commits/quartz-colored-glyphs. r?jrmuizel
Approved for 92.0b5. Thanks for including a test.
Updated•3 years ago
|
Comment 19•3 years ago
|
||
bugherder uplift |
https://hg.mozilla.org/releases/mozilla-beta/rev/af1f843786e3
https://hg.mozilla.org/releases/mozilla-beta/rev/981634e8a433
Updated•3 years ago
|
Updated•3 years ago
|
Comment 20•3 years ago
|
||
Managed to reproduce the issue on Nightly 2021-08-03 using macOS 10.15.
Retested everything on Nightly 93.0a1 and Firefox 92.0b6 using macOS 10.15, Windows 10 x64 and Ubuntu 16.04 x64. The issue is not reproducing anymore.
Comment 21•3 years ago
|
||
Please nominate this for ESR91 approval also when you get a chance.
Assignee | ||
Comment 22•3 years ago
|
||
Comment on attachment 9234960 [details]
Bug 1723787 - Apply cairo quartz font/surface changes from Andrea Canciani's quartz-colored-glyphs branch at https://gitlab.freedesktop.org/ranma42/cairo/-/commits/quartz-colored-glyphs. r?jrmuizel
ESR Uplift Approval Request
- If this is not a sec:{high,crit} bug, please state case for ESR consideration: Regression with significant user impact, low-risk fix
- User impact if declined: Emoji fail to appear in print/PDF output on macOS
- Fix Landed on Version: 92
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Merging changes from an upstream branch that has been around quite a while (and is based on what we used to have in Gecko's old forked cairo), so it's pretty well tested/reviewed code.
Fix verified on Nightly and Beta already.
- String or UUID changes made by this patch:
Assignee | ||
Updated•3 years ago
|
Comment 23•3 years ago
|
||
Comment on attachment 9234960 [details]
Bug 1723787 - Apply cairo quartz font/surface changes from Andrea Canciani's quartz-colored-glyphs branch at https://gitlab.freedesktop.org/ranma42/cairo/-/commits/quartz-colored-glyphs. r?jrmuizel
Approved for 91.1esr.
Updated•3 years ago
|
Comment 24•3 years ago
|
||
bugherder uplift |
Description
•