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 ## Unicode combining
In order to handle combining characters (typically diacritics), foot When the client prints Unicode combining characters, e.g `a\\u0308`
must store additional data for each cell. By default, foot stores at ('a' + `COMBINING DIAERESIS`), foot will be default try to create a
most 2 combining characters per cell. This adds 9 bytes of additional pre-composed character. For example, `\\u0061\\u0308` (`a\\u0308`)
space to each cell, or 75% more space than without combining will be transformed into `\\u00e5` (`å`).
characters).
You can configure the maximum number of characters to store for each This is to improve the looks of the rendered grapheme. When rendering
cell at **compile time** with a decomposed string, `a\\u0308`, the glyphs for `a` and `\\u0308` are
`-Dunicode-max-combining-chars=<int>`. Setting this to `0` rendered independently, on top off each other. The result if often not
**disables** unicode combining completely - **no** additional data is optimal, with e.g. diacritics looking a bit out of place. If we are
stored. 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 When rendering a pre-composed character, we are rendering a single
character,, foot will by default try to convert the base and combining glyph only and thus it is guaranteed to look the way the font designer
characters to a pre-composed character. intended it to.
This will typically look better since we can now render a single Still, if you do not want this, you can disable pre-composing at
glyph, the way the font designer intended it to be rendered. When **compile time** with `-Dunicode-precompose=false`.
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 ## Requirements