Compare commits

...

6 Commits

Author SHA1 Message Date
calixteman
efc5c3c231
Merge pull request #19862 from calixteman/bug1961423
Fix 'print to pdf' on Mac with a cid font (bug 1961423)
2025-04-25 15:11:55 +02:00
Jonas Jenwald
312c85bfd6
Merge pull request #19815 from Snuffleupagus/getMergedResources-size
Ensure that "local" /Contents stream-dict /Resources aren't empty (PR 19803 follow-up)
2025-04-25 10:46:04 +02:00
Jonas Jenwald
1a5c9e90dd
Merge pull request #19861 from Snuffleupagus/debugger-fix-light-dark-fallout
Fix the debugger CSS when using the dark theme (PR 19819 follow-up)
2025-04-25 10:44:55 +02:00
Calixte Denizet
785991a97c Fix 'print to pdf' on Mac with a cid font (bug 1961423) 2025-04-24 20:19:12 +02:00
Jonas Jenwald
6b76bdac3a Fix the debugger CSS when using the dark theme (PR 19819 follow-up)
Perhaps we should update the debugger CSS to properly account for the light/dark theme, however since that's not UI that end-users ever see we simply force using the light theme for now.
2025-04-24 17:34:29 +02:00
Jonas Jenwald
245d9ba925 Ensure that "local" /Contents stream-dict /Resources aren't empty (PR 19803 follow-up)
This is a small, and quite possibly pointless, optimization which ensures that any "local" /Resources aren't empty, to avoid needlessly trying to load and merge dictionaries.
2025-04-14 09:58:15 +02:00
4 changed files with 12 additions and 5 deletions

View File

@ -1769,12 +1769,16 @@ class CFFCompiler {
if (isCIDFont) {
// In a CID font, the charset is a mapping of CIDs not SIDs so just
// create an identity mapping.
// nLeft: Glyphs left in range (excluding first) (see the CFF specs).
// Having a wrong value for nLeft induces a print issue on MacOS (see
// https://bugzilla.mozilla.org/1961423).
const nLeft = numGlyphsLessNotDef - 1;
out = new Uint8Array([
2, // format
0, // first CID upper byte
0, // first CID lower byte
(numGlyphsLessNotDef >> 8) & 0xff,
numGlyphsLessNotDef & 0xff,
(nLeft >> 8) & 0xff,
nLeft & 0xff,
]);
} else {
const length = 1 + numGlyphsLessNotDef * 2;

View File

@ -427,7 +427,7 @@ class Page {
// available (see issue18894.pdf).
const localResources = streamDict?.get("Resources");
if (!(localResources instanceof Dict)) {
if (!(localResources instanceof Dict && localResources.size)) {
return this.resources;
}
const objectLoader = new ObjectLoader(localResources, keys, this.xref);

View File

@ -481,7 +481,7 @@ describe("CFFCompiler", function () {
0, // cid (high)
0, // cid (low)
0, // nLeft (high)
numGlyphs - 1, // nLeft (low)
numGlyphs - 2, // nLeft (low)
]);
});

View File

@ -22,7 +22,10 @@
font: message-box;
}
#PDFBug {
background-color: rgb(255 255 255);
color-scheme: only light;
background-color: white;
color: black;
border: 1px solid rgb(102 102 102);
position: fixed;
top: 32px;