Describe the bug
Surrogate pairs render brokenly, because fontSubstitution walks the string one UTF-16 code unit at a time and queries the high and low surrogate halves against hasGlyphForCodePoint separately, so the combined code point is never looked up in the font stack.
Affected characters
To Reproduce
playgorund
Expected behavior
fontSubstitution should combine each surrogate pair into its single code point before consulting the font stack, so a font that supports surrogate pair (e.g. Noto Sans JP for U+20BB7) is picked and the glyph renders correctly.
Desktop (please complete the following information):
- OS: Linux
- Browser: Node.js
- React-pdf version: v4.5.1
Describe the bug
Surrogate pairs render brokenly, because
fontSubstitutionwalks the string one UTF-16 code unit at a time and queries the high and low surrogate halves againsthasGlyphForCodePointseparately, so the combined code point is never looked up in the font stack.Affected characters
𠮷U+20BB7),To Reproduce
playgorund
Expected behavior
fontSubstitutionshould combine each surrogate pair into its single code point before consulting the font stack, so a font that supports surrogate pair (e.g. Noto Sans JP forU+20BB7) is picked and the glyph renders correctly.Desktop (please complete the following information):