config: add grapheme-width-method=default

This is the new default mode, and tries to do "the right thing". That
is, recognize and handle:

* Variation Selector 16 (graphical presentation)
* ZWJ sequences
* Skin tones and hair-styles
* Country flags

Things known to be incorrect:

* "Invalid" country letter combinations are still treated as
  flags. That is, the combined width is 2, even though it should be 4.
This commit is contained in:
Daniel Eklöf 2022-12-14 14:35:00 +01:00
parent 3b9aca6a3d
commit ab39ed99df
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 80 additions and 11 deletions

View file

@ -326,6 +326,7 @@ struct config {
bool overflowing_glyphs;
bool grapheme_shaping;
enum {
GRAPHEME_WIDTH_DEFAULT,
GRAPHEME_WIDTH_WCSWIDTH,
GRAPHEME_WIDTH_DOUBLE,
GRAPHEME_WIDTH_MAX,