1#! /bin/sh
2# Copyright(c) 2018 Thomas Wolff <towo@towo.net>
3
4# generate WIDTH-A file, listing Unicode characters with width property
5# Ambiguous, from EastAsianWidth.txt
6
7if [ ! -r EastAsianWidth.txt ]
8then	ln -s /usr/share/unicode/ucd/EastAsianWidth.txt . || exit 1
9fi
10if [ ! -r UnicodeData.txt ]
11then	ln -s /usr/share/unicode/ucd/UnicodeData.txt . || exit 1
12fi
13if [ ! -r Blocks.txt ]
14then	ln -s /usr/share/unicode/ucd/Blocks.txt . || exit 1
15fi
16
17sed -e "s,^\([^;]*\);A,\1," -e t -e d EastAsianWidth.txt > width-a-new
18rm -f WIDTH-A
19echo "# UAX #11: East Asian Ambiguous" > WIDTH-A
20PATH="$PATH:." uniset +width-a-new compact >> WIDTH-A
21rm -f width-a-new
22