1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-29 15:47:57 +02:00

Introduce some logical assignment in the src/core/ folder

This commit is contained in:
Jonas Jenwald 2022-07-17 11:24:05 +02:00
parent 317abd6d07
commit d950b91c4e
20 changed files with 62 additions and 103 deletions

View file

@ -743,7 +743,7 @@ function validateOS2Table(os2, file) {
}
function createOS2Table(properties, charstrings, override) {
override = override || {
override ||= {
unitsPerEm: 0,
yMax: 0,
yMin: 0,
@ -3090,10 +3090,7 @@ class Font {
let charCodes = null;
for (const charCode in charCodeToGlyphId) {
if (glyphId === charCodeToGlyphId[charCode]) {
if (!charCodes) {
charCodes = [];
}
charCodes.push(charCode | 0);
(charCodes ||= []).push(charCode | 0);
}
}
return charCodes;
@ -3285,8 +3282,7 @@ class Font {
break; // the non-zero width found
}
}
width = width || this.defaultWidth;
return shadow(this, "spaceWidth", width);
return shadow(this, "spaceWidth", width || this.defaultWidth);
}
/**