Closed NinthDesertDude closed 11 months ago
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.'