-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better handling of unicode supplementary chars
Supplementary characters require 2 java/kotlin chars to store but are rendered as a single character. This caused problems for a lot of places that assumed length = number of chars. Replaced the buffer in TextSurface to be an array of codepoints (int) rather than a plain String (which would have an undefined length if surrogate pairs are used). Iterate through the codepoints rather than chars. Note this is more consistent but not necessarily always better than to measuring these as 2 chars. Text measurement is complicated.
- Loading branch information
1 parent
0b2efcd
commit 2ef687d
Showing
3 changed files
with
73 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters