]> git.saurik.com Git - wxWidgets.git/blame - misc/unictabl/mk_fallbacks.sh
proper default for iphone
[wxWidgets.git] / misc / unictabl / mk_fallbacks.sh
CommitLineData
045c4fab 1#!/bin/sh
045c4fab
VS
2
3
4add_fallback()
5{
6 echo " - for $3..."
7 cat _tmp3 | grep "$1" | while read i ; do
8 code=`echo $i | cut -c1-6`
9 echo "$code $2" >> _tmp5
10 done
11}
12
13
14echo " * getting list of needed unicode characters..."
15
16cat mappings/*.TXT | sed -n '/^0x../p' | \
17 cut -f2,4 | sort | uniq | sed -n '/^0x/p' > _tmp1
18cat _tmp1 | cut -f1 | sort | uniq > _tmp2
19
20
21echo " * making unique list of unicode characters meanings..."
22
23rm -f _tmp3
24cat _tmp2 | while read i ; do
25 sed -n "/^$i/p" _tmp1 | (read t ; echo "$t" >> _tmp3)
26done
27
28cp _tmp3 UnicodeChars
29
30echo " * creating one-byte fallback tables..."
31
32rm -f Fallbacks _tmp5
33
34echo " - for latin capital letters..."
35
36cat _tmp3 | grep 'LATIN CAPITAL LETTER [A-Z]$' > _tmp6
37cat _tmp3 | grep 'LATIN CAPITAL LETTER [A-Z] WITH' >> _tmp6
38cat _tmp6 | sort +2 > _tmp4
39
40cat _tmp4 | while read i ; do
41 code=`echo $i | cut -c1-6`
42 fallb=`echo $i | cut -c8-29`
43 cat _tmp4 | fgrep "$fallb" | cut -c1-6 | (read i ;
44 echo "$code $i" >> _tmp5)
45done
46
47
48echo " - for latin small letters..."
49
50cat _tmp3 | grep 'LATIN SMALL LETTER [A-Z]$' > _tmp6
51cat _tmp3 | grep 'LATIN SMALL LETTER [A-Z] WITH' >> _tmp6
52cat _tmp6 | sort +2 > _tmp4
53
54cat _tmp4 | while read i ; do
55 code=`echo $i | cut -c1-6`
56 fallb=`echo $i | cut -c8-27`
57 cat _tmp4 | fgrep "$fallb" | cut -c1-6 | (read i ;
58 echo "$code $i" >> _tmp5)
59done
60
61
62add_fallback "DOUBLE .*QUOTATION MARK" "0x0022" "double quotations"
63add_fallback "SINGLE .*QUOTATION MARK" "0x0027" "single quotations"
64add_fallback "DASH" "0x002D" "dashes"
65
66
67
68echo " * removing infinite loops from fallback tables..."
69
70cat _tmp5 | grep -v '\(0x....\) \1' | sort > Fallbacks
71
72rm -f _tmp1 _tmp2 _tmp3 _tmp4 _tmp5 _tmp6
73