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. --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 4271920b..5c3d0875 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ The fast, lightweight and minimalistic Wayland terminal emulator. 1. [Backspace](#backspace) 1. [DPI and font size](#dpi-and-font-size) 1. [Supported OSCs](#supported-oscs) +1. [Unicode combining](#unicode-combining) 1. [Requirements](#requirements) 1. [Running](#running) 1. [Building](#building) @@ -268,6 +269,33 @@ with the terminal emulator itself. Foot implements the following OSCs: * `OSC 555` - flash screen (**foot specific**) +## Unicode combining + +In order to handle combining characters, foot must store additional +data for each cell. By default, foot stores at most 2 combining +characters per cell. This adds 9 bytes of additional space to each +cell (that's 75% more space than without combining characters). + +You can configure the maximum number of characters to store for each +cell at **compile time** with +`-Dunicode-max-combining-chars=`. Setting this to `0` +**disables** unicode combining completely - **no** additional data is +stored. + +Furthermore, in order to improve rendering of combining characters, +foot will by default try to convert base + combining characters to a +pre-composed character. + +This will typically look better, since we can now render a single +glyph, the way the font designer intended it to be rendered. When +pre-composing fails, foot will fallback to storing the combining +character(s) separate from the base character, and will render the +final grapheme by rendering the base and combining glyphs separately. + +You can disable pre-composing at **compile time** with +`-Dunicode-precompose=false`. + + ## Requirements ### Running -- cgit v1.3