From d945b68b734427a03d114716ff8aeac7998a7c57 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 2 May 2020 17:29:00 +0200 Subject: unicode-combine: remove utf8proc dependency We only used utf8proc to try to pre-compose a glyph from a base and combining character. We can do this ourselves by using a pre-compiled table of valid pre-compositions. This table isn't _that_ big, and binary searching it is fast. That is, for a very small amount of code, and not too much extra RO data, we can get rid of the utf8proc dependency. --- terminal.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'terminal.h') diff --git a/terminal.h b/terminal.h index 93e6fea8..2292e927 100644 --- a/terminal.h +++ b/terminal.h @@ -77,10 +77,10 @@ struct damage { int lines; }; -#if FOOT_UNICODE_COMBINING +#if FOOT_UNICODE_MAX_COMBINING_CHARS > 0 struct combining_chars { uint8_t count; - wchar_t chars[2]; /* This is XTerms default, but there _are_ cases where more are needed */ + wchar_t chars[FOOT_UNICODE_MAX_COMBINING_CHARS]; } __attribute__((packed)); #endif @@ -89,7 +89,7 @@ struct row { bool dirty; bool linebreak; -#if FOOT_UNICODE_COMBINING +#if FOOT_UNICODE_MAX_COMBINING_CHARS > 0 struct combining_chars *comb_chars; #endif }; -- cgit v1.3