diff --git a/docs/changelog.md b/docs/changelog.md index fe901c3f0..779e1e760 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -67,6 +67,7 @@ As features stabilize some brief notes about them will accumulate here. * Detaching an ssh multiplexer domain sometimes killed the associated panes! [#1993](https://github.com/wez/wezterm/issues/1993) * `DecreaseFontSize` wasn't quite the inverse of `IncreaseFontSize`. Thanks to [@Funami580](https://github.com/Funami580)! [#1997](https://github.com/wez/wezterm/pull/1997) * Wayland: unable to paste text that was copied before starting the initial wezterm window. Thanks to [@Funami580](https://github.com/Funami580)! [#1994](https://github.com/wez/wezterm/pull/1994) [#1385](https://github.com/wez/wezterm/issues/1385) +* Unicode NFD text could incorrectly render with repeated glyphs [#2032](https://github.com/wez/wezterm/issues/2032) ### 20220408-101518-b908e2dd diff --git a/wezterm-font/src/shaper/harfbuzz.rs b/wezterm-font/src/shaper/harfbuzz.rs index 4a7d8ce0c..bb131b506 100644 --- a/wezterm-font/src/shaper/harfbuzz.rs +++ b/wezterm-font/src/shaper/harfbuzz.rs @@ -401,13 +401,21 @@ impl HarfbuzzShaper { std::mem::swap(&mut info, prior); prior.len += info.len; continue; + } else if info.cluster + info.len == prior.cluster + prior.len { + // Overlaps and coincide with the end of prior; this one folds away. + // This can happen with NFD rather than NFC text. + // + continue; } + // log::info!("prior={:#?}, info={:#?}", prior, info); } } } info_clusters.push(vec![info]); } // log::error!("do_shape: font_idx={} {:?} {:#?}", font_idx, &s[range.clone()], info_clusters); + // log::info!("cluster_info: {:#?}", cluster_info); + // log::info!("info_clusters: {:#?}", info_clusters); let mut direct_clusters = 0; @@ -425,7 +433,6 @@ impl HarfbuzzShaper { log::error!("incomplete cluster for text={:?} {:?}", s, info_clusters); } */ - //println!("Incomplete: {:?}. infos: {:?}", cluster_info, infos); let first_info = &infos[0];