Merge pull request #19996 from calixteman/bug1961423_bis

Fix a printing issue on Mac (bug 1961423)
This commit is contained in:
calixteman 2025-06-17 21:23:49 +02:00 committed by GitHub
commit 412500c9b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -1770,13 +1770,13 @@ class CFFCompiler {
// 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
// The first CID must be 1 in order to avoid a print issue on mac (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
1, // first CID lower byte
(nLeft >> 8) & 0xff,
nLeft & 0xff,
]);

View File

@ -479,7 +479,7 @@ describe("CFFCompiler", function () {
expect(out).toEqual([
2, // format
0, // cid (high)
0, // cid (low)
1, // cid (low)
0, // nLeft (high)
numGlyphs - 2, // nLeft (low)
]);