diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2024-06-24 18:21:46 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2024-06-25 06:20:20 +0000 |
| commit | 94583703e12fc46a1ca16718a18579f8db2be0f8 (patch) | |
| tree | 9e8c88ba101aae6de353743c3c1fab06122ff4b1 /vt.c | |
| parent | doc: foot.ini: fix typos (diff) | |
vt: don't ignore VS-15 (text presentation)
When we encounter either VS-15 or VS-16, set the grapheme width to 1
or 2 explicitly.
Diffstat (limited to 'vt.c')
| -rw-r--r-- | vt.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -852,9 +852,11 @@ action_utf8_print(struct terminal *term, char32_t wc) break; case GRAPHEME_WIDTH_DOUBLE: + new_cc->width = min(grapheme_width + width, 2); + #if defined(FOOT_GRAPHEME_CLUSTERING) if (unlikely(grapheme_clustering && - wc == 0xfe0f && + (wc == 0xfe0e || wc == 0xfe0f) && new_cc->count == 2)) { /* Only emojis should be affected by VS16 */ @@ -862,11 +864,10 @@ action_utf8_print(struct terminal *term, char32_t wc) utf8proc_get_property(new_cc->chars[0]); if (props->boundclass == UTF8PROC_BOUNDCLASS_EXTENDED_PICTOGRAPHIC) - width = 2; + new_cc->width = wc - 0xfe0d; /* 1 for VS-15, 2 for VS-16 */ } #endif - new_cc->width = min(grapheme_width + width, 2); break; case GRAPHEME_WIDTH_WCSWIDTH: |
