Prioritise Unicode Full encoding over Unicode BMP Only #93
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.
Currently, if both Full and BMPOnly Unicode cmaps are present, the library will pick whichever one it finds first. This means for libraries that have extended characters (for example, https://fonts.google.com/noto/specimen/Noto+Emoji ) will not render any characters beyond U+FFFF - which includes a lot of the common emoji.
This change alters the priority order to decode the Full table if present, over the BMPOnly table.
It maintains the previous behavior for the Microsoft platform tables (the last one in the file is used, if no Unicode table is present).
There is a potential change in behavior if existing code relied on the library silently not rendering characters outside the BMP, but this was inconsistent anyway as in most cases the not-found box symbol (Index 0) was rendered instead.
It's possible this may cause a regression in the case of a broken font file, where the BMPOnly table was correct but the Full table was broken. I cannot find any such fonts, and this would be a significant error in the font creation itself so is unlikely to be an issue.