mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-24 16:07:22 +02:00
Compare commits
4 Commits
9efd9fa2c7
...
ab124db046
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab124db046 | ||
|
|
27e171ea38 | ||
|
|
8f56ee2ae9 | ||
|
|
81644a7ee9 |
21
package-lock.json
generated
21
package-lock.json
generated
@ -2565,9 +2565,6 @@
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@ -2589,9 +2586,6 @@
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@ -2613,9 +2607,6 @@
|
||||
"riscv64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@ -2637,9 +2628,6 @@
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@ -2661,9 +2649,6 @@
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@ -4235,9 +4220,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/basic-ftp": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.2.0.tgz",
|
||||
"integrity": "sha512-VoMINM2rqJwJgfdHq6RiUudKt2BV+FY5ZFezP/ypmwayk68+NzzAQy4XXLlqsGD4MCzq3DrmNFD/uUmBJuGoXw==",
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.2.1.tgz",
|
||||
"integrity": "sha512-0yaL8JdxTknKDILitVpfYfV2Ob6yb3udX/hK97M7I3jOeznBNxQPtVvTUtnhUkyHlxFWyr5Lvknmgzoc7jf+1Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
|
||||
@ -3311,19 +3311,25 @@ class Font {
|
||||
"hmtx",
|
||||
(function fontFieldsHmtx() {
|
||||
const charstrings = font.charstrings;
|
||||
const cffWidths = font.cff ? font.cff.widths : null;
|
||||
let hmtx = "\x00\x00\x00\x00"; // Fake .notdef
|
||||
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;
|
||||
|
||||
for (let i = 1, ii = numGlyphs; i < ii; i++) {
|
||||
let width = 0;
|
||||
if (charstrings) {
|
||||
const charstring = charstrings[i - 1];
|
||||
width = "width" in charstring ? charstring.width : 0;
|
||||
width = charstrings[i - 1].width || 0;
|
||||
} else if (cffWidths) {
|
||||
width = Math.ceil(cffWidths[i] || 0);
|
||||
}
|
||||
hmtx += string16(width) + string16(0);
|
||||
data[pos++] = (width >> 8) & 0xff;
|
||||
data[pos++] = width & 0xff;
|
||||
// Use lsb=0, skip redundant assignment.
|
||||
pos += 2;
|
||||
}
|
||||
return hmtx;
|
||||
return data;
|
||||
})()
|
||||
);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user