diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-05-03 09:36:20 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-05-03 09:36:20 +0000 |
| commit | 1d1eb899257a98db81d2cd3a634135b60ba0d0ba (patch) | |
| tree | 14d141ed96f7e47a6adb6102a0ab1626cd125a29 /README.md | |
| parent | osc: fix scaling of RGB formatted color specifiers (diff) | |
| parent | unicode-combining: limit maximum number of allowed composed chains (diff) | |
Merge branch 'space-optimize-combining-chars'
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 36 |
1 files changed, 15 insertions, 21 deletions
@@ -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 |
