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();
|
||||
for (let charCode = 0; charCode < 256; charCode++) {
|
||||
let glyphName;
|
||||
if (this.differences && charCode in this.differences) {
|
||||
if (this.differences[charCode] !== undefined) {
|
||||
glyphName = this.differences[charCode];
|
||||
} else if (
|
||||
charCode in baseEncoding &&
|
||||
baseEncoding[charCode] !== ""
|
||||
) {
|
||||
} else if (baseEncoding[charCode] !== "") {
|
||||
glyphName = baseEncoding[charCode];
|
||||
} else {
|
||||
glyphName = StandardEncoding[charCode];
|
||||
|
Loading…
x
Reference in New Issue
Block a user