readme: update 'Unicode combining'

This commit is contained in:
Daniel Eklöf 2020-05-03 11:21:31 +02:00
parent 62e0774319
commit 9638d0213b
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -271,30 +271,24 @@ with the terminal emulator itself. Foot implements the following OSCs:
## Unicode combining
In order to handle combining characters (typically diacritics), 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, or 75% more space than without combining
characters).
When the client prints Unicode combining characters, e.g `a\\u0308`
('a' + `COMBINING DIAERESIS`), foot will be default try to create a
pre-composed character. For example, `\\u0061\\u0308` (`a\\u0308`)
will be transformed into `\\u00e5` (`å`).
You can configure the maximum number of characters to store for each
cell at **compile time** with
`-Dunicode-max-combining-chars=<int>`. Setting this to `0`
**disables** unicode combining completely - **no** additional data is
stored.
This is to improve the looks of the rendered grapheme. When rendering
a decomposed string, `a\\u0308`, the glyphs for `a` and `\\u0308` are
rendered independently, on top off each other. The result if often not
optimal, with e.g. diacritics looking a bit out of place. If we are
really unlucky, the base character and the combining characters may be
picked from different fonts, making the result look even more awkward.
Furthermore, in order to improve the looks of the rendered combined
character,, foot will by default try to convert the base and combining
characters to a pre-composed character.
When rendering a pre-composed character, we are rendering a single
glyph only and thus it is guaranteed to look the way the font designer
intended it to.
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`.
Still, if you do not want this, you can disable pre-composing at
**compile time** with `-Dunicode-precompose=false`.
## Requirements