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

View File

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