mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-08-02 20:37:21 +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"
|
"arm64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@ -2589,9 +2586,6 @@
|
|||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@ -2613,9 +2607,6 @@
|
|||||||
"riscv64"
|
"riscv64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@ -2637,9 +2628,6 @@
|
|||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@ -2661,9 +2649,6 @@
|
|||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@ -4235,9 +4220,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/basic-ftp": {
|
"node_modules/basic-ftp": {
|
||||||
"version": "5.2.0",
|
"version": "5.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.2.1.tgz",
|
||||||
"integrity": "sha512-VoMINM2rqJwJgfdHq6RiUudKt2BV+FY5ZFezP/ypmwayk68+NzzAQy4XXLlqsGD4MCzq3DrmNFD/uUmBJuGoXw==",
|
"integrity": "sha512-0yaL8JdxTknKDILitVpfYfV2Ob6yb3udX/hK97M7I3jOeznBNxQPtVvTUtnhUkyHlxFWyr5Lvknmgzoc7jf+1Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|||||||
@ -3311,19 +3311,25 @@ class Font {
|
|||||||
"hmtx",
|
"hmtx",
|
||||||
(function fontFieldsHmtx() {
|
(function fontFieldsHmtx() {
|
||||||
const charstrings = font.charstrings;
|
const charstrings = font.charstrings;
|
||||||
const cffWidths = font.cff ? font.cff.widths : null;
|
const cffWidths = 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) {
|
||||||
const charstring = charstrings[i - 1];
|
width = charstrings[i - 1].width || 0;
|
||||||
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);
|
||||||
}
|
}
|
||||||
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