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 =
|
||||
typeof fontCharCode === "number"
|
||||
? String.fromCodePoint(fontCharCode)
|
||||
: "";
|
||||
let fontChar = "";
|
||||
if (typeof fontCharCode === "number") {
|
||||
if (fontCharCode <= 0x10ffff) {
|
||||
fontChar = String.fromCodePoint(fontCharCode);
|
||||
} else {
|
||||
warn(`charToGlyph - invalid fontCharCode: ${fontCharCode}`);
|
||||
}
|
||||
}
|
||||
|
||||
var glyph = this.glyphCache[charcode];
|
||||
if (
|
||||
|
Loading…
Reference in New Issue
Block a user