-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
Crash: pasting 💁👌🎍😍 in a textbox crashes #446
Comments
wondering, would it work in Label? |
@rds1983 It's blank, it doesn't display the text but it does not crash. |
yeah, probably default font ttf simply doesnt have glyphs for it |
Updated with the exact issue in source code. Hopefully FontStashSharp has a way to read the number of characters that're in a codepoint, because all navigation in the textbox would have to start doing that to deal with this scenario...alternatively, handle this crash by rejecting typed or pasted content that would result in Text.Length not matching the Glyphs array size (basically forcing glyph to be only one character long) until generic Unicode support can be done. |
Should be fixed after updating to FSS 1.3.5 |
Repro using this string: 💁👌🎍😍
In TextChunk.cs, this is the problematic function:
We have index = 7 because each emoji is composed of 2 characters due to being Unicode. Text.Length is 8. Glyphs is an array of size 4, because it's from FontStashSharp and they know we only have 4 characters here. We're trying to access index 7 in Glyphs, so we get
System.ArgumentOutOfRangeException: 'Index was out of range.'
The text was updated successfully, but these errors were encountered: