]>
Commit | Line | Data |
---|---|---|
045c4fab | 1 | #!/bin/sh |
045c4fab VS |
2 | |
3 | ||
4 | echo " * compiling C source generator..." | |
5 | ||
6 | cc mk_ctable.c -o mk_ctable | |
7 | ||
8 | echo " * writing copyright info..." | |
9 | ||
10 | echo " | |
11 | ||
12 | /* | |
c260cbf8 | 13 | * This file is #included by encconv.cpp |
045c4fab | 14 | * |
045c4fab | 15 | * |
c260cbf8 MR |
16 | * *** *** CAUTION! *** *** |
17 | * Do not modify this file by hand! It is generated by shell | |
18 | * script \$(WXWIN)/misc/unictabl/regenerate | |
045c4fab | 19 | * |
c260cbf8 MR |
20 | * Parts of this file are based on tables published by Unicode, Inc. |
21 | * Original tables are freely available at | |
22 | * ftp://ftp.unicode.org/Public/MAPPINGS | |
045c4fab | 23 | * |
c260cbf8 | 24 | * Original copyright info as present in mapping tables follows: |
045c4fab VS |
25 | * |
26 | * | |
c260cbf8 | 27 | * Copyright (c) 1991-1999 Unicode, Inc. All Rights reserved. |
045c4fab | 28 | * |
c260cbf8 MR |
29 | * This file is provided as-is by Unicode, Inc. (The Unicode Consortium). |
30 | * No claims are made as to fitness for any particular purpose. No | |
31 | * warranties of any kind are expressed or implied. The recipient | |
32 | * agrees to determine applicability of information provided. If this | |
33 | * file has been provided on optical media by Unicode, Inc., the sole | |
34 | * remedy for any claim will be exchange of defective media within 90 | |
35 | * days of receipt. | |
045c4fab | 36 | * |
c260cbf8 MR |
37 | * Unicode, Inc. hereby grants the right to freely use the information |
38 | * supplied in this file in the creation of products supporting the | |
39 | * Unicode Standard, and to make copies of this file in any form for | |
40 | * internal or external distribution as long as this notice remains | |
41 | * attached. | |
045c4fab VS |
42 | */ |
43 | ||
44 | " > unictabl.inc | |
45 | ||
46 | ||
47 | echo " * creating C tables..." | |
48 | ||
49 | all_encodings="" | |
50 | ||
51 | for i in mappings/*.TXT ; do | |
52 | ||
53 | enc=`echo $i | cut -c10- | tr - _ | sed 's/\.TXT//g' |\ | |
54 | sed 's/8859_\(.*\)/ISO8859_\1/g | |
55 | s/KOI8_R/KOI8/g'` | |
56 | cat $i | sed -n '/^0x...0x..../p' | cut -f1,2 | \ | |
57 | ./mk_ctable $i $enc >> unictabl.inc | |
58 | all_encodings="$all_encodings $enc" | |
59 | ||
60 | done | |
61 | ||
62 | rm -f mk_ctable | |
63 | ||
64 | ||
65 | echo " * adding fallback..." | |
66 | ||
67 | echo " | |
68 | ||
69 | ||
70 | ||
71 | ||
72 | /* | |
73 | * | |
74 | * Unicode to 7bit ASCII fallback | |
75 | * (for use with wxRECODE_SUBSTITUTE recoding mode) | |
76 | * | |
77 | */ | |
78 | ||
39a31a2d | 79 | static const struct { |
045c4fab VS |
80 | wxUint16 c /*code*/; |
81 | wxUint8 s /*inaccurate substitution*/; | |
82 | } encoding_unicode_fallback[] = { | |
83 | " >> unictabl.inc | |
84 | ||
85 | cat Fallbacks | while read i ; do | |
86 | code=`echo "$i" | cut -f1` | |
87 | subs=`echo "$i" | cut -f2 | cut -c1-2,5-6` | |
88 | echo " {$code, $subs}," >> unictabl.inc | |
89 | done | |
90 | echo " {0, 0}" >> unictabl.inc | |
91 | echo " };" >> unictabl.inc | |
92 | echo " | |
39a31a2d | 93 | static const unsigned encoding_unicode_fallback_count = "`cat Fallbacks | wc -l`";" >> unictabl.inc |
045c4fab VS |
94 | |
95 | ||
96 | echo " * adding reference table..." | |
97 | ||
98 | ||
99 | echo " | |
100 | ||
101 | ||
102 | ||
103 | /* | |
104 | * | |
105 | * Table of all supported encodings: | |
106 | * | |
107 | */ | |
108 | ||
39a31a2d | 109 | static const struct { |
045c4fab | 110 | wxFontEncoding encoding; // encoding identifier |
cd1a22d1 | 111 | const wxUint16 *table; // 8bit to unicode table |
045c4fab VS |
112 | } encodings_list[] = { |
113 | " >> unictabl.inc | |
114 | ||
115 | for i in $all_encodings ; do | |
116 | echo " { wxFONTENCODING_$i, encoding_table__$i}," >> unictabl.inc | |
117 | done | |
118 | ||
119 | echo " {wxFONTENCODING_MAX /*anything*/, NULL}" >> unictabl.inc | |
120 | echo " };" >> unictabl.inc |