From b1b32152c182fdb0b9494e75acb605d0486e30fa Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Fri, 8 May 2020 23:36:33 +0200 Subject: unicode-precompose: use fcft's precompose functionality This allows us more options when determining whether to use a pre-composed character or not: We now only use the pre-composed character if it's from the primary font, or if at least one of the base or combining characters are from a fallback font. I.e. use glyphs from the primary font if possible. But, if one or more of the decomposed glyphs are from a fallback font, use the pre-composed character anyway. --- meson.build | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'meson.build') diff --git a/meson.build b/meson.build index 495653d0..9d468862 100644 --- a/meson.build +++ b/meson.build @@ -92,17 +92,6 @@ foreach prot : [ command: [wscanner_prog, 'private-code', '@INPUT@', '@OUTPUT@']) endforeach -if get_option('unicode-precompose') - generate_unicode_precompose_sh = files('scripts/generate-unicode-precompose.sh') - unicode_data = custom_target( - 'unicode-data', - input: 'UnicodeData.txt', - output: 'unicode-compose-table.h', - command: [generate_unicode_precompose_sh, '@INPUT@', '@OUTPUT@']) -else - unicode_data = [] -endif - generate_version_sh = files('generate-version.sh') version = custom_target( 'generate_version', @@ -138,7 +127,7 @@ executable( 'tokenize.c', 'tokenize.h', 'vt.c', 'vt.h', 'wayland.c', 'wayland.h', - wl_proto_src + wl_proto_headers, version, unicode_data, + wl_proto_src + wl_proto_headers, version, dependencies: [math, threads, pixman, wayland_client, wayland_cursor, xkb, tllist, fcft], install: true) -- cgit v1.3 From 718ba1602adf4a306327545849d043d982953d40 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 9 May 2020 10:58:45 +0200 Subject: meson: explicitly define _POSIX_C_SOURCE --- meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'meson.build') diff --git a/meson.build b/meson.build index 9d468862..36d1bafa 100644 --- a/meson.build +++ b/meson.build @@ -13,7 +13,8 @@ is_debug_build = get_option('buildtype').startswith('debug') cc = meson.get_compiler('c') add_project_arguments( - ['-D_GNU_SOURCE=200809L'] + (is_debug_build ? ['-D_DEBUG'] : []) + + ['-D_POSIX_C_SOURCE=200809L', '-D_GNU_SOURCE=200809L'] + + (is_debug_build ? ['-D_DEBUG'] : []) + cc.get_supported_arguments( ['-fstrict-aliasing', '-Wstrict-aliasing', -- cgit v1.3 From cce76909c40ab68a4285d9a8cb63edcf16732418 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 9 May 2020 11:15:56 +0200 Subject: meson/PKGBUILD: we now require fcft-2.1.0 --- PKGBUILD | 2 +- meson.build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'meson.build') diff --git a/PKGBUILD b/PKGBUILD index aae75222..19724182 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -5,7 +5,7 @@ arch=('x86_64') url=https://codeberg.org/dnkl/foot license=(mit) makedepends=('meson' 'ninja' 'scdoc' 'python' 'ncurses' 'wayland-protocols' 'tllist>=1.0.1') -depends=('libxkbcommon' 'wayland' 'pixman' 'fcft>=2.0.0') +depends=('libxkbcommon' 'wayland' 'pixman' 'fcft>=2.1.0') source=() pkgver() { diff --git a/meson.build b/meson.build index 36d1bafa..6d02b38f 100644 --- a/meson.build +++ b/meson.build @@ -62,7 +62,7 @@ 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.0.0', '<2.1.0'], fallback: 'fcft') +fcft = dependency('fcft', version: ['>=2.1.0', '<3.0.0'], fallback: 'fcft') wayland_protocols_datadir = wayland_protocols.get_pkgconfig_variable('pkgdatadir') -- cgit v1.3 From 00df12f1a3cfee6c0f876f4e082ce3efbeba0bda Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sun, 10 May 2020 17:10:33 +0200 Subject: 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. --- CHANGELOG.md | 4 +--- README.md | 28 ---------------------------- meson.build | 15 ++++++--------- meson_options.txt | 2 -- vt.c | 2 -- 5 files changed, 7 insertions(+), 44 deletions(-) delete mode 100644 meson_options.txt (limited to 'meson.build') diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c2e7c68..e763f6dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index 08a9fdb1..b55dd8aa 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/meson.build b/meson.build index 6d02b38f..83df931a 100644 --- a/meson.build +++ b/meson.build @@ -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( +# { +# '': false, +# }, +# bool_yn: true +# ) diff --git a/meson_options.txt b/meson_options.txt deleted file mode 100644 index 5052f66c..00000000 --- a/meson_options.txt +++ /dev/null @@ -1,2 +0,0 @@ -option('unicode-precompose', type: 'boolean', value: true, - description: 'Convert decomposed characters to precomposed. Ignored if "unicode-combining" has been disabled') diff --git a/vt.c b/vt.c index 9c639431..d80a7d86 100644 --- a/vt.c +++ b/vt.c @@ -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)) { -- cgit v1.3