-
Notifications
You must be signed in to change notification settings - Fork 474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug/Feature(?): make a version of find_glyph
for ttf::Font
that supports characters beyond the Basic Multilingual Plane
#1383
Comments
find_glyph
for ttf::Font
that supports characters beyond the Basic Multilingual Planefind_glyph
for ttf::Font
that supports characters beyond the Basic Multilingual Plane
find_glyph
for ttf::Font
that supports characters beyond the Basic Multilingual Planefind_glyph
for ttf::Font
that supports characters beyond the Basic Multilingual Plane
Looks like a bug, but it requires a breaking change to fix (fortunately rather easy to fix on the client's side) |
@Cobrand how could that be fixed client-side?? Also - a non-breaking change would be to introduce a new function 'find_glyph_32' that fixes this. |
Here is how I understand it:
But it's true we can also add a |
@Cobrand I agree, adding a Wouldn't it be worth a breaking change in this case though? The current version of |
The current implementation of
find_glyph
forttf::Font
looks like this:There is a major problem with this: if the input char is something like the
🤣
emoji (which has a numerical value of129315
), it'll get cast tou16
and become63779
. This can then lead to false positives, where fonts say that they support a UTF-8 codepoint, when they do in fact not; and vice versa for fonts that aim to only support emoji-like characters (like plane 1 in GNU Unifont).The solution to this would be simple: either patch this function to use TTF_GlyphIsProvided32 instead (and without the
u16
cast), or make a separate function calledfind_glyph_32
.Please fix this! It would be enormously helpful.
The text was updated successfully, but these errors were encountered: