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

mkunidata « string « libc « newlib - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7b6135f8d29f62ca628fda33dbb598b9403795eb (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#! /bin/sh

echo Generating Unicode width data for newlib/libc/string/wcwidth.c

cd `dirname $0`
PATH="$PATH":.	# ensure access to uniset tool

#############################################################################
# checks and (with option -u) downloads

case "$1" in
-h)	echo "Usage: $0 [-h|-u|-i]"
	echo "Generate width data tables ambiguous.t, combining.t, wide.t"
	echo "from local Unicode files UnicodeData.txt, Blocks.txt, EastAsianWidth.txt."
	echo ""
	echo "Options:"
	echo "  -u    download files from unicode.org first, download uniset tool"
	echo "  -i    copy files from /usr/share/unicode/ucd first"
	echo "  -h    show this"
	exit
	;;
-u)
	wget () {
		ref=`basename $1`
		ref=`ls "$ref" 2> /dev/null || echo 01-Jan-1970`
		curl -R -O --connect-timeout 55 -z "$ref" "$1"
	}

	echo downloading uniset tool
	wget https://www.cl.cam.ac.uk/~mgk25/download/uniset.tar.gz
	gzip -dc uniset.tar.gz | tar xvf - uniset

	echo downloading data from unicode.org
	for data in UnicodeData.txt Blocks.txt EastAsianWidth.txt
	do	wget http://unicode.org/Public/UNIDATA/$data
	done
	;;
-i)
	echo copying data from /usr/share/unicode/ucd
	for data in UnicodeData.txt Blocks.txt EastAsianWidth.txt
	do	cp /usr/share/unicode/ucd/$data .
	done
	;;
esac

echo checking uniset tool
type uniset || exit 9

echo checking Unicode data files
for data in UnicodeData.txt Blocks.txt EastAsianWidth.txt
do	if [ -r $data ]
	then	true
	else	echo $data not available, skipping table generation
		exit
	fi
done

echo generating from Unicode version `sed -e 's,[^.0-9],,g' -e 1q Blocks.txt`

#############################################################################
# table generation

echo generating combining characters table
uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B +D7B0-D7C6 +D7CB-D7FB c > combining.t

echo generating ambiguous width characters table
sh ./mkwidthA && uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf c > ambiguous.t

echo generating wide characters table
sh ./mkwide

#############################################################################
# end