Remove unnecessary in
checks of Arrays, when building the charCodeToGlyphId
for TrueType fonts
Note that all standard Encodings have the same length (i.e. `256` elements) and that missing entries are always represented by empty strings, hence why a separate exists-check isn't necessary in the `baseEncoding` case.
This commit is contained in:
parent
edc38de37a
commit
7190bc23a8
@ -2550,12 +2550,9 @@ class Font {
|
|||||||
const glyphsUnicodeMap = getGlyphsUnicode();
|
const glyphsUnicodeMap = getGlyphsUnicode();
|
||||||
for (let charCode = 0; charCode < 256; charCode++) {
|
for (let charCode = 0; charCode < 256; charCode++) {
|
||||||
let glyphName;
|
let glyphName;
|
||||||
if (this.differences && charCode in this.differences) {
|
if (this.differences[charCode] !== undefined) {
|
||||||
glyphName = this.differences[charCode];
|
glyphName = this.differences[charCode];
|
||||||
} else if (
|
} else if (baseEncoding[charCode] !== "") {
|
||||||
charCode in baseEncoding &&
|
|
||||||
baseEncoding[charCode] !== ""
|
|
||||||
) {
|
|
||||||
glyphName = baseEncoding[charCode];
|
glyphName = baseEncoding[charCode];
|
||||||
} else {
|
} else {
|
||||||
glyphName = StandardEncoding[charCode];
|
glyphName = StandardEncoding[charCode];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user