From 70b324b24c86473a99528feb6f1f91ca70e11a02 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Thu, 24 Apr 2025 08:23:56 +0200 Subject: term: ignore LTR+RTL markers (U+200E + U+200F) Foot doesn't implement RTL, and explicit LTR markers is neither needed, nor used in anyway. In fact, they cause issues with font lookup, as fcft often fails to find the marker codepoint in the primary font, causing a fallback font to be used instead. Closes #2049 --- terminal.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'terminal.c') diff --git a/terminal.c b/terminal.c index ae1adb1a..59c39760 100644 --- a/terminal.c +++ b/terminal.c @@ -4156,6 +4156,14 @@ term_process_and_print_non_ascii(struct terminal *term, char32_t wc) (grapheme_clustering || (!grapheme_clustering && width == 0 && wc >= 0x300))) { + if (unlikely(wc == 0x200e || wc == 0x200f)) { + /* + * Ignore left-to-right and right-to-left markers + * see https://codeberg.org/dnkl/foot/issues/2049 + */ + return; + } + int col = term->grid->cursor.point.col; if (!term->grid->cursor.lcf) col--; -- cgit v1.3 From 1b15cc5f3d633809114d9d569b34abf934426c69 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Thu, 24 Apr 2025 18:20:18 +0200 Subject: Revert "term: ignore LTR+RTL markers (U+200E + U+200F)" This reverts commit 70b324b24c86473a99528feb6f1f91ca70e11a02. --- CHANGELOG.md | 9 --------- terminal.c | 8 -------- 2 files changed, 17 deletions(-) (limited to 'terminal.c') diff --git a/CHANGELOG.md b/CHANGELOG.md index 62dc7e03..35669f03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,13 +63,6 @@ ## Unreleased ### Added ### Changed - -* Left-to-right and right-to-left markers (U+200E and U+200F) are now - ignored ([#2049][2049]). - -[2049]: https://codeberg.org/dnkl/foot/issues/2049 - - ### Deprecated ### Removed ### Fixed @@ -80,8 +73,6 @@ codepoints ([#2039][2039]). * Keyboard modifiers not being reset on keyboard leave events ([#2034][2034]). -* Last character in a `remind` calendar event being in the wrong font - and color ([#2049][2049]). [2039]: https://codeberg.org/dnkl/foot/issues/2039 [2034]: https://codeberg.org/dnkl/foot/issues/2034 diff --git a/terminal.c b/terminal.c index 59c39760..ae1adb1a 100644 --- a/terminal.c +++ b/terminal.c @@ -4156,14 +4156,6 @@ term_process_and_print_non_ascii(struct terminal *term, char32_t wc) (grapheme_clustering || (!grapheme_clustering && width == 0 && wc >= 0x300))) { - if (unlikely(wc == 0x200e || wc == 0x200f)) { - /* - * Ignore left-to-right and right-to-left markers - * see https://codeberg.org/dnkl/foot/issues/2049 - */ - return; - } - int col = term->grid->cursor.point.col; if (!term->grid->cursor.lcf) col--; -- cgit v1.3 From 1fec0cf5ea0c3fe3be92a49eaee5eef5aafa9c49 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Thu, 24 Apr 2025 18:22:37 +0200 Subject: Revert "term: append zero-width grapheme breaking characters to previous cell" This reverts commit 76503fb86a8b8a6b5c3ce1be87c15a55af38508d. --- CHANGELOG.md | 4 ++-- terminal.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'terminal.c') diff --git a/CHANGELOG.md b/CHANGELOG.md index 35669f03..1aedf331 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -229,9 +229,9 @@ enabled ([#1947][1947]). * Reflow of the cursor (active + saved) when at the end of the line with a pending wrap (LCF set) ([#1954][1954]). -* Zero-width characters that also are grapheme breaks (e.g. U+200B, +* ~~Zero-width characters that also are grapheme breaks (e.g. U+200B, ZERO WIDTH SPACE) being ignored (discarded and never stored in the - grid) ([#1960][1960]). + grid) ([#1960][1960]).~~ (reverted) * `--server=` not working on FreeBSD ([#1956][1956]). * Crash when resetting the terminal and an application had previously set a custom app ID ([#1963][1963]) diff --git a/terminal.c b/terminal.c index ae1adb1a..f2d03e77 100644 --- a/terminal.c +++ b/terminal.c @@ -4188,7 +4188,7 @@ term_process_and_print_non_ascii(struct terminal *term, char32_t wc) if (grapheme_clustering) { /* Check if we're on a grapheme cluster break */ if (utf8proc_grapheme_break_stateful( - last, wc, &term->vt.grapheme_state) && width > 0) + last, wc, &term->vt.grapheme_state)) { term_reset_grapheme_state(term); goto out; -- cgit v1.3