Closed Majora320 closed 3 years ago
Quick look through the code reveals the likely culprit: count_trailing_whitespace
in text/lines.rs is returning count
which is a number of code points, but it's being interpreted as utf-8 code units. The count
should be replaced by something like a sum of len_utf8.
Note: This was a bug I observed when building something with druid, but since the traceback led to this library I'm filing it here as that is likely where the issue lies.
When rendering the character U+3000 IDEOGRAPHIC SPACE ( ) at the end of a line or by itself, the program panics and this a message similar to this one is printed (this specific example is for a string containing the character alone):
I'm not sure if this is a bug in piet, cairo, or what have you, but I would appreciate it being looked into.