diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-05-08 21:36:33 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-05-09 10:06:11 +0000 |
| commit | b1b32152c182fdb0b9494e75acb605d0486e30fa (patch) | |
| tree | eaf68cba1d4be835de96a505370fe5f230a00681 /scripts | |
| parent | Revert "term: print: line-wrap multi-column characters instead of cutting them in half" (diff) | |
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.
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/generate-unicode-precompose.sh | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/scripts/generate-unicode-precompose.sh b/scripts/generate-unicode-precompose.sh deleted file mode 100755 index 49e12650..00000000 --- a/scripts/generate-unicode-precompose.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/sh - -unicodedata_txt="${1}" -output="${2}" - -cat <<EOF > "${output}" -#pragma once - -#include <wchar.h> - -static const struct { - wchar_t replacement; - wchar_t base; - wchar_t comb; -} precompose_table[] = { -EOF - -# extract canonical decomposition data from UnicodeData.txt, -# - pad hex values to 5 digits, -# - sort numerically on base character, then combining character, -# - then reduce to 4 digits again where possible -# -# "borrowed" from xterm/unicode/make-precompose.sh - -cut "${unicodedata_txt}" -d ";" -f 1,6 | - grep ";[0-9,A-F]" | grep " " | - sed -e "s/ /, 0x/;s/^/{ 0x/;s/;/, 0x/;s/$/},/" | - sed -e "s,0x\(....\)\([^0-9A-Fa-f]\),0x0\1\2,g" | - (sort -k 3 || sort +2) | - sed -e "s,0x0\(...[0-9A-Fa-f]\),0x\1,g" | - sed 's/^/ /' >> "${output}" - -echo "};" >> "${output}" |
