2014-05-09 23:51:44 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#See http://www.unicode.org/reports/tr44/
|
|
|
|
#
|
|
|
|
#Me Enclosing_Mark an enclosing combining mark
|
|
|
|
#Mn Nonspacing_Mark a nonspacing combining mark (zero advance width)
|
|
|
|
#Cf Format a format control character
|
|
|
|
#
|
2016-12-14 00:31:39 +01:00
|
|
|
cd "$(dirname "$0")"
|
|
|
|
UNICODEWIDTH_H=$(git rev-parse --show-toplevel)/unicode_width.h
|
2016-12-14 00:31:40 +01:00
|
|
|
|
2016-12-14 00:31:42 +01:00
|
|
|
wget -N http://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt \
|
|
|
|
http://www.unicode.org/Public/UCD/latest/ucd/EastAsianWidth.txt &&
|
2016-12-14 00:31:40 +01:00
|
|
|
if ! test -d uniset; then
|
2016-12-14 00:31:41 +01:00
|
|
|
git clone https://github.com/depp/uniset.git &&
|
|
|
|
( cd uniset && git checkout 4b186196dd )
|
2016-12-14 00:31:40 +01:00
|
|
|
fi &&
|
2016-12-14 00:31:39 +01:00
|
|
|
(
|
2016-12-14 00:31:40 +01:00
|
|
|
cd uniset &&
|
|
|
|
if ! test -x uniset; then
|
|
|
|
autoreconf -i &&
|
|
|
|
./configure --enable-warnings=-Werror CFLAGS='-O0 -ggdb'
|
2014-05-09 23:51:44 +02:00
|
|
|
fi &&
|
2016-12-14 00:31:40 +01:00
|
|
|
make
|
|
|
|
) &&
|
|
|
|
UNICODE_DIR=. && export UNICODE_DIR &&
|
|
|
|
cat >$UNICODEWIDTH_H <<-EOF
|
|
|
|
static const struct interval zero_width[] = {
|
2016-12-14 00:31:43 +01:00
|
|
|
$(uniset/uniset --32 cat:Me,Mn,Cf + U+1160..U+11FF - U+00AD)
|
2016-12-14 00:31:40 +01:00
|
|
|
};
|
|
|
|
static const struct interval double_width[] = {
|
|
|
|
$(uniset/uniset --32 eaw:F,W)
|
|
|
|
};
|
|
|
|
EOF
|