unicode-combine: simplify - remove -Dunicode-precompose option

Since the pre-composing functionality is now part of fcft, it makes
little sense to have a compile time option - there's no size benefit
to be had.

Furthermore, virtually all terminal emulators do
pre-composing (alacritty being an exception), this really isn't that
controversial.
This commit is contained in:
Daniel Eklöf 2020-05-10 17:10:33 +02:00
parent 77e256763c
commit 00df12f1a3
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
5 changed files with 7 additions and 44 deletions

View file

@ -22,9 +22,7 @@
* Right mouse button extends the current selection.
* `CSI Ps ; Ps ; Ps t` escape sequences for the following parameters:
`11t`, `13t`, `13;2t`, `14t`, `14;2t`, `15t`, `19t`.
* Unicode combining characters. Parts of this feature are compile time
optional. See [README.md](README.md#user-content-unicode-combining)
for details.
* Unicode combining characters.
### Changed

View file

@ -16,7 +16,6 @@ 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)
@ -269,33 +268,6 @@ with the terminal emulator itself. Foot implements the following OSCs:
* `OSC 555` - flash screen (**foot specific**)
## Unicode combining
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` (`å`).
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.
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.
Note that foot currently will choose to render the decomposed form
**if** the pre-composed character **does not** exist in the primary
font, **and** both the decomposed characters **do**. In all other
cases, the pre-composed character is preferred.
Still, if you do not want this, you can disable pre-composing at
**compile time** with `-Dunicode-precompose=false`.
## Requirements
### Running

View file

@ -58,9 +58,6 @@ wayland_client = dependency('wayland-client')
wayland_cursor = dependency('wayland-cursor')
xkb = dependency('xkbcommon')
add_project_arguments('-DFOOT_UNICODE_PRECOMPOSE=@0@'.format(
get_option('unicode-precompose')), language: 'c')
tllist = dependency('tllist', version: '>=1.0.1', fallback: 'tllist')
fcft = dependency('fcft', version: ['>=2.1.0', '<3.0.0'], fallback: 'fcft')
@ -153,9 +150,9 @@ install_data('footrc', install_dir: join_paths(get_option('datadir'), 'foot'))
subdir('completions')
subdir('doc')
summary(
{
'Unicode precompose': get_option('unicode-precompose'),
},
bool_yn: true
)
# summary(
# {
# '<feature>': false,
# },
# bool_yn: true
# )

View file

@ -1,2 +0,0 @@
option('unicode-precompose', type: 'boolean', value: true,
description: 'Convert decomposed characters to precomposed. Ignored if "unicode-combining" has been disabled')

2
vt.c
View file

@ -595,7 +595,6 @@ action_utf8_print(struct terminal *term, uint8_t c)
term->grid->cursor.point.col = base_col;
term->grid->cursor.lcf = false;
#if FOOT_UNICODE_PRECOMPOSE
if (composed == NULL) {
bool base_from_primary;
bool comb_from_primary;
@ -627,7 +626,6 @@ action_utf8_print(struct terminal *term, uint8_t c)
return;
}
}
#endif
size_t wanted_count = composed != NULL ? composed->count + 1 : 1;
if (wanted_count > ALEN(composed->combining)) {