Join GitHub today
CJK soft wrap #9162
Instead of considering every character to have the same width when we perform soft-wrapping, we now make a distinction between default characters, double width characters, half width characters and Korean characters .
The strategy consists in measuring these kinds of characters once when sampling font styles and then using the calculated width to find where a certain line wraps.
Please, note that this won't work with non-monospaced fonts, but it's consistent with how we currently handle soft-wrapping for latin characters.
I had to treat Korean characters differently, as their width isn't the same as japanese and chinese. I couldn't find a good name to express this in code (as opposed to double width and half width), so I simply named them
Honestly I performed only super basic tests to check if this worked fine: probably a native speaker could give a more detailed feedback. I'll make sure to mention some of the people who actively participated in the CJK discussion if this looks good code-wise.
referenced this pull request
Oct 15, 2015
Korean characters use spaces but usually they don't wrap by words. For example:
Web browser behavior example: https://twitter.com/newstapa/status/654793987543306241
@saschanaz: I wonder if, as a first step, it could be acceptable to wrap by words. How bad do you think that would be? The