From b9ef703eb14ba2357b847b62a715b4e97f690209 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Thu, 20 Aug 2020 19:25:35 +0200 Subject: wip: grapheme shaping --- terminal.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'terminal.h') diff --git a/terminal.h b/terminal.h index e6bcfa40..45c6c98b 100644 --- a/terminal.h +++ b/terminal.h @@ -8,6 +8,10 @@ #include #include +#if defined(FOOT_GRAPHEME_CLUSTERING) + #include +#endif + #include #include @@ -81,8 +85,7 @@ struct damage { }; struct composed { - wchar_t base; - wchar_t combining[5]; + wchar_t chars[20]; uint8_t count; }; @@ -152,6 +155,9 @@ struct vt_param { struct vt { int state; /* enum state */ wchar_t last_printed; +#if defined(FOOT_GRAPHEME_CLUSTERING) + utf8proc_int32_t grapheme_state; +#endif wchar_t utf8; struct { struct vt_param v[16]; @@ -720,3 +726,10 @@ void term_collect_urls(struct terminal *term); void term_osc8_open(struct terminal *term, uint64_t id, const char *uri); void term_osc8_close(struct terminal *term); + +static inline void term_reset_grapheme_state(struct terminal *term) +{ +#if defined(FOOT_GRAPHEME_CLUSTERING) + term->vt.grapheme_state = 0; +#endif +} -- cgit v1.3