Welcome to mirror list, hosted at ThFree Co, Russian Federation.

mkwide « string « libc « newlib - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 55a0bab4304b02d08f45976a8a3207464a9341c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#! /bin/sh

# generate list of wide characters, with convex closure

skipcheck=false

if [ ! -r EastAsianWidth.txt ]
then	ln -s /usr/share/unicode/ucd/EastAsianWidth.txt . || exit 1
fi
if [ ! -r UnicodeData.txt ]
then	ln -s /usr/share/unicode/ucd/UnicodeData.txt . || exit 1
fi
if [ ! -r Blocks.txt ]
then	ln -s /usr/share/unicode/ucd/Blocks.txt . || exit 1
fi

sed -e "s,^\([^;]*\);[NAH],\1," -e t -e d EastAsianWidth.txt > wide.na
sed -e "s,^\([^;]*\);[WF],\1," -e t -e d EastAsianWidth.txt > wide.fw

PATH="$PATH:." # for uniset

nrfw=`uniset +wide.fw nr | sed -e 's,.*:,,'`
echo FW $nrfw
nrna=`uniset +wide.na nr | sed -e 's,.*:,,'`
echo NAH $nrna

extrablocks="2E80-303E"

# check all blocks
includes () {
	nr=`uniset +wide.$2 -$1 nr | sed -e 's,.*:,,'`
	test $nr != $3
}
echo "adding compact closure of wide ranges, this may take ~10min"
for b in $extrablocks `sed -e 's,^\([0-9A-F]*\)\.\.\([0-9A-F]*\).*,\1-\2,' -e t -e d Blocks.txt`
do	range=$b
	echo checking $range $* >&2
	if includes $range fw $nrfw && ! includes $range na $nrna
	then	echo $range
	fi
done > wide.blocks

(
sed -e "s,^,//," -e 1q EastAsianWidth.txt
sed -e "s,^,//," -e 1q Blocks.txt
uniset `sed -e 's,^,+,' wide.blocks` +wide.fw c
) > wide.t

rm -f wide.na wide.fw wide.blocks