Torsten Bögershausen | 9c94389 | 2014-05-09 23:51:44 +0200 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | #See http://www.unicode.org/reports/tr44/ |
| 3 | # |
| 4 | #Me Enclosing_Mark an enclosing combining mark |
| 5 | #Mn Nonspacing_Mark a nonspacing combining mark (zero advance width) |
| 6 | #Cf Format a format control character |
| 7 | # |
Beat Bolli | f3eb549 | 2016-12-14 00:31:39 +0100 | [diff] [blame] | 8 | cd "$(dirname "$0")" |
Stefan Beller | e233bef | 2018-04-10 14:26:17 -0700 | [diff] [blame] | 9 | UNICODEWIDTH_H=$(git rev-parse --show-toplevel)/unicode-width.h |
Beat Bolli | b79e28e | 2016-12-14 00:31:40 +0100 | [diff] [blame] | 10 | |
Beat Bolli | fef54f3 | 2016-12-14 00:31:42 +0100 | [diff] [blame] | 11 | wget -N http://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt \ |
| 12 | http://www.unicode.org/Public/UCD/latest/ucd/EastAsianWidth.txt && |
Beat Bolli | b79e28e | 2016-12-14 00:31:40 +0100 | [diff] [blame] | 13 | if ! test -d uniset; then |
Beat Bolli | 3f0a386 | 2016-12-14 00:31:41 +0100 | [diff] [blame] | 14 | git clone https://github.com/depp/uniset.git && |
| 15 | ( cd uniset && git checkout 4b186196dd ) |
Beat Bolli | b79e28e | 2016-12-14 00:31:40 +0100 | [diff] [blame] | 16 | fi && |
Beat Bolli | f3eb549 | 2016-12-14 00:31:39 +0100 | [diff] [blame] | 17 | ( |
Beat Bolli | b79e28e | 2016-12-14 00:31:40 +0100 | [diff] [blame] | 18 | cd uniset && |
| 19 | if ! test -x uniset; then |
| 20 | autoreconf -i && |
| 21 | ./configure --enable-warnings=-Werror CFLAGS='-O0 -ggdb' |
Torsten Bögershausen | 9c94389 | 2014-05-09 23:51:44 +0200 | [diff] [blame] | 22 | fi && |
Beat Bolli | b79e28e | 2016-12-14 00:31:40 +0100 | [diff] [blame] | 23 | make |
| 24 | ) && |
| 25 | UNICODE_DIR=. && export UNICODE_DIR && |
| 26 | cat >$UNICODEWIDTH_H <<-EOF |
| 27 | static const struct interval zero_width[] = { |
Beat Bolli | 3fe5799 | 2016-12-14 00:31:43 +0100 | [diff] [blame] | 28 | $(uniset/uniset --32 cat:Me,Mn,Cf + U+1160..U+11FF - U+00AD) |
Beat Bolli | b79e28e | 2016-12-14 00:31:40 +0100 | [diff] [blame] | 29 | }; |
| 30 | static const struct interval double_width[] = { |
| 31 | $(uniset/uniset --32 eaw:F,W) |
| 32 | }; |
| 33 | EOF |