mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
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
1 changed files with 8 additions and 4 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue