mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-21 05:33:45 -04:00
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.
This commit is contained in:
parent
8389c76549
commit
d945b68b73
13 changed files with 34934 additions and 40 deletions
28
README.md
28
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=<int>`. 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue