Merge pull request #11769 from Snuffleupagus/charToGlyph-fontCharCode-range
Ensure that `Font.charToGlyph` won't fail because `String.fromCodePoint` is given an invalid code point (issue 11768)
This commit is contained in:
commit
702fec534d
@ -3216,10 +3216,14 @@ var Font = (function FontClosure() {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
var fontChar =
|
let fontChar = "";
|
||||||
typeof fontCharCode === "number"
|
if (typeof fontCharCode === "number") {
|
||||||
? String.fromCodePoint(fontCharCode)
|
if (fontCharCode <= 0x10ffff) {
|
||||||
: "";
|
fontChar = String.fromCodePoint(fontCharCode);
|
||||||
|
} else {
|
||||||
|
warn(`charToGlyph - invalid fontCharCode: ${fontCharCode}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var glyph = this.glyphCache[charcode];
|
var glyph = this.glyphCache[charcode];
|
||||||
if (
|
if (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user