From 62e07743194c8051334ed9b23be90ce31ab80773 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sun, 3 May 2020 11:03:22 +0200 Subject: unicode-combining: store seen combining chains "globally" in the term struct Instead of storing combining data per cell, realize that most combinations are re-occurring and that there's lots of available space left in the unicode range, and store seen base+combining combinations chains in a per-terminal array. When we encounter a combining character, we first try to pre-compose, like before. If that fails, we then search for the current base+combining combo in the list of previously seen combinations. If not found there either, we allocate a new combo and add it to the list. Regardless, the result is an index into this array. We store this index, offsetted by COMB_CHARS_LO=0x40000000ul in the cell. When rendering, we need to check if the cell character is a plain character, or if it's a composed character (identified by checking if the cell character is >= COMB_CHARS_LO). Then we render the grapheme pretty much like before. --- meson_options.txt | 3 --- 1 file changed, 3 deletions(-) (limited to 'meson_options.txt') diff --git a/meson_options.txt b/meson_options.txt index 42a0663d..5052f66c 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,5 +1,2 @@ -option('unicode-max-combining-chars', type: 'integer', value: 2, - description: 'Maximum number of combining characters to track per cell. A value of 0 completely disables unicode combining (this reduces the runtime memory footprint)') - option('unicode-precompose', type: 'boolean', value: true, description: 'Convert decomposed characters to precomposed. Ignored if "unicode-combining" has been disabled') -- cgit v1.3