blob: dbc20c90fb665024aeed830986e39c01acf97616 (
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
#!/bin/sh
nopsc=`grep 'CAPITAL' ../UnicodeData-2.txt`
IFS="
"
#echo "#
# List of case chars
#
#
# Format: Three tab-separated columns
# Column #1 is the non-spacing Unicode (in hex as 0xXXXX)
# Column #2 is the spacing Unicode (in hex as 0xXXXX)
# Column #3 the Unicode name (follows a comment sign, '#')
# " > case.txt
rm -f case.txt
for line in ${nopsc}
do
ucs=`echo ${line} | cut -d\; -f1`
name=`echo ${line} | cut -d\; -f2 | cut -d\; -f1| sed s/CAPITAL/SMALL/`
small=`grep ";${name};" ../UnicodeData-2.txt`
if test "X${small}" != X ;then
tbl=`echo ${small} | cut -d\; -f1`
# echo "0x${ucs} 0x${tbl} # ${name}" >> space.txt
echo "/* U+${ucs} */ 0x${tbl}," >> case.txt
else
# echo "0x${ucs} 0x${ucs} # ${name}" >> space.txt
echo "/* U+${ucs} */ 0x0," >> case.txt
fi
done
unset nospc
# echo "/* EOF */" >> space.txt
cat case.txt | ./create_table "spacing" > "../headers/case.h" 2> ../headers/case_tbl.txt
rm -f case.txt
cat >../case.c << ENDOFTEXT
/*
* Author: Jean-Marc Lienher ( http://oksid.ch )
* Copyright 2000-2003 by O'ksi'D.
*
* This library is free software. Distribution and use rights are outlined in
* the file "COPYING" which should have been included with this file. If this
* file is missing or damaged, see the license at:
*
* https://www.fltk.org/COPYING.php
*
* Please see the following page on how to report bugs and issues:
*
* https://www.fltk.org/bugs.php
*/
#include "headers/case.h"
ENDOFTEXT
echo "
int
XUtf8Tolower(
int ucs)
{
int ret;
" >>../case.c
tables=`cat ../headers/case_tbl.txt`
for line in ${tables}
do
tbl=`echo ${line} | cut -d']' -f1`
bot=`echo ${line} | cut -d'_' -f3 | cut -d'[' -f1`
eot=`echo ${line} | cut -d' ' -f2 | cut -d'+' -f2 | cut -d' ' -f1`
echo "\
if (ucs <= 0x${eot}) {
if (ucs >= 0x${bot}) {
ret = ${tbl}ucs - 0x${bot}];
if (ret > 0) return ret;
}
return ucs;
}
" >>../case.c
done
echo " return ucs;
}
" >>../case.c
|