Open adamjack opened 1 year ago
More carefully inspect the font for "character width" for each character (rune) and do not crash if the font does not have a width for the character.
I was receiving this crash on line 28 when the string contained a single right apostrophe:
panic: runtime error: index out of range [8217] with length 256
P.S. I am no expert but as I was looking around the utf8File seemed a reasonable place to look for more widths.
If it cannot find a width for the character it uses a placeholder, using underscore 'cos "wider seemed safer".
More carefully inspect the font for "character width" for each character (rune) and do not crash if the font does not have a width for the character.
I was receiving this crash on line 28 when the string contained a single right apostrophe:
P.S. I am no expert but as I was looking around the utf8File seemed a reasonable place to look for more widths.
If it cannot find a width for the character it uses a placeholder, using underscore 'cos "wider seemed safer".