Compare commits

..

No commits in common. "ab124db0469c3ea26fb9a471944f22259137497e" and "9efd9fa2c7bb862ffaa1282c165a201868136092" have entirely different histories.

2 changed files with 24 additions and 15 deletions

21
package-lock.json generated
View File

@ -2565,6 +2565,9 @@
"arm64" "arm64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@ -2586,6 +2589,9 @@
"arm64" "arm64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@ -2607,6 +2613,9 @@
"riscv64" "riscv64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@ -2628,6 +2637,9 @@
"x64" "x64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@ -2649,6 +2661,9 @@
"x64" "x64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@ -4220,9 +4235,9 @@
} }
}, },
"node_modules/basic-ftp": { "node_modules/basic-ftp": {
"version": "5.2.1", "version": "5.2.0",
"resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.2.1.tgz", "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.2.0.tgz",
"integrity": "sha512-0yaL8JdxTknKDILitVpfYfV2Ob6yb3udX/hK97M7I3jOeznBNxQPtVvTUtnhUkyHlxFWyr5Lvknmgzoc7jf+1Q==", "integrity": "sha512-VoMINM2rqJwJgfdHq6RiUudKt2BV+FY5ZFezP/ypmwayk68+NzzAQy4XXLlqsGD4MCzq3DrmNFD/uUmBJuGoXw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {

View File

@ -3311,25 +3311,19 @@ class Font {
"hmtx", "hmtx",
(function fontFieldsHmtx() { (function fontFieldsHmtx() {
const charstrings = font.charstrings; const charstrings = font.charstrings;
const cffWidths = font.cff?.widths ?? null; const cffWidths = font.cff ? font.cff.widths : null;
let hmtx = "\x00\x00\x00\x00"; // Fake .notdef
const data = new Uint8Array(numGlyphs * 4);
// Fake .notdef (width=0 and lsb=0) first, skip redundant assignment.
let pos = 4;
for (let i = 1, ii = numGlyphs; i < ii; i++) { for (let i = 1, ii = numGlyphs; i < ii; i++) {
let width = 0; let width = 0;
if (charstrings) { if (charstrings) {
width = charstrings[i - 1].width || 0; const charstring = charstrings[i - 1];
width = "width" in charstring ? charstring.width : 0;
} else if (cffWidths) { } else if (cffWidths) {
width = Math.ceil(cffWidths[i] || 0); width = Math.ceil(cffWidths[i] || 0);
} }
data[pos++] = (width >> 8) & 0xff; hmtx += string16(width) + string16(0);
data[pos++] = width & 0xff;
// Use lsb=0, skip redundant assignment.
pos += 2;
} }
return data; return hmtx;
})() })()
); );