Only fallback to checking properties.widths
for composite fonts with IdentityToUnicodeMap
s in the hasGlyph
helper function (issue 8570, issue 8255)
#8572
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please note: The commit message was updated to mention that the patch fixes two open issues, however no functional code changes were made!
For
IdentityToUnicodeMap
s it doesn't make much sense to check if a particularcharCode
exists in thetoUnicode
map, since it includes all of them by design.However, completely ignoring missing glyphs for fonts with
IdentityToUnicodeMap
s caused glyph mapping issues in practice, so PR #5990 added a heuristic to instead check if awidth
entry existed for the glyph.The intention of that PR was that it should apply to
IdentityToUnicodeMap
s, but given how the code was (and still is) written it ended up applying to all composite fonts instead.This thus causes us to needlessly map a lot of glyphs, which since they are not found in the
toUnicode
map, results in us trying to move more glyphs than can actually fit into the Private Use Area. Hence why we end up with glyphs that fail to render successfully.Hopefully we've got sufficient test coverage for this code!
As usual, I've successfully run all unit/font/reference tests locally with this patch.
Fixes #8570.
Fixes #8255.