8 void generateGlyphByIDS(const GString *in, GString *out, int flag){
\r
9 GString *tmp1, *tmp2, *tmp3, *tmp4;
\r
11 //pass this method if 'in' is not UCS parts
\r
12 if((in->str)[0] != 'u'){
\r
13 generateGlyph(in, out);
\r
16 //pass this method if 'in' is place-variant-flag defined
\r
17 if(in->len < 5 && 7 < in->len){
\r
18 generateGlyph(in, out);
\r
22 tmp1 = g_string_new(in->str);
\r
23 tmp2 = g_string_new(in->str);
\r
24 // tmp3 = g_string_new(in->str);
\r
25 // tmp4 = g_string_new(in->str);
\r
27 //append design flag
\r
28 // if(kDesign == 10) g_string_append(tmp1, "-10");
\r
29 // else if(kDesign == 11) g_string_append(tmp1, "-11");
\r
30 // else if(kDesign == 20) g_string_append(tmp1, "-20");
\r
31 // else if(kDesign == 30) g_string_append(tmp1, "-30");
\r
32 // else if(kDesign == 40) g_string_append(tmp1, "-40");
\r
33 // else g_string_append(tmp1, "-00");
\r
34 // if(kDesign == 10) g_string_append(tmp2, "-10");
\r
35 // else if(kDesign == 11) g_string_append(tmp2, "-11");
\r
36 // else if(kDesign == 20) g_string_append(tmp2, "-20");
\r
37 // else if(kDesign == 30) g_string_append(tmp2, "-30");
\r
38 // else if(kDesign == 40) g_string_append(tmp2, "-40");
\r
39 // else g_string_append(tmp2, "-00");
\r
40 // g_string_append(tmp3, "-00");
\r
41 // g_string_append(tmp4, "-00");
\r
44 if(1 <= flag && flag <= 7){
\r
45 if(tmp1->len != 7) g_string_append(tmp1, "-");
\r
46 if(flag == 1) g_string_append(tmp1, "01");
\r
47 else if(flag == 2) g_string_append(tmp1, "02");
\r
48 else if(flag == 3) g_string_append(tmp1, "03");
\r
49 else if(flag == 4) g_string_append(tmp1, "04");
\r
50 else if(flag == 5) g_string_append(tmp1, "05");
\r
51 else if(flag == 6) g_string_append(tmp1, "06");
\r
54 // g_string_append(tmp2, "00");
\r
55 // if(flag == 1) g_string_append(tmp3, "01");
\r
56 // else if(flag == 2) g_string_append(tmp3, "02");
\r
57 // else if(flag == 3) g_string_append(tmp3, "03");
\r
58 // else if(flag == 4) g_string_append(tmp3, "04");
\r
59 // else if(flag == 5) g_string_append(tmp3, "05");
\r
60 // else if(flag == 6) g_string_append(tmp3, "06");
\r
61 // else g_string_append(tmp3, "00");
\r
62 // g_string_append(tmp4, "00");
\r
64 generateGlyph(tmp1, out);
\r
65 if(out->len != 0) return;
\r
66 generateGlyph(tmp2, out);
\r
67 if(out->len != 0) return;
\r
68 // generateGlyph(tmp3, out);
\r
69 // if(out->len != 0) return;
\r
70 // generateGlyph(tmp4, out);
\r
74 void generateGlyph(const GString *in, GString *out){
\r
76 tmp = g_string_new("");
\r
77 g_string_set_size(out, 0);
\r
79 // in2 = g_string_new(in->str);
\r
82 // if(*(in2->str) == 'u' && (in2->len == 4 || in2->len == 5)){
\r
83 // //append design flag
\r
84 // if(kDesign == 10) g_string_append(in2, "-1000");
\r
85 // else if(kDesign == 11) g_string_append(in2, "-1100");
\r
86 // else if(kDesign == 20) g_string_append(in2, "-2000");
\r
87 // else if(kDesign == 30) g_string_append(in2, "-3000");
\r
88 // else if(kDesign == 40) g_string_append(in2, "-4000");
\r
89 // else g_string_append(in2, "-0000");
\r
91 //search from parts(1st)
\r
92 // searchPartsData(in2, tmp);
\r
93 // if(tmp->len != 0){
\r
94 // g_string_assign(out, tmp->str);
\r
98 //search from alias(1st)
\r
99 // searchAliasData(in2, tmp);
\r
100 // if(tmp->len != 0){
\r
101 // generateGlyph(tmp, out);
\r
102 // if(out->len == 0) return;
\r
103 // //save to cache ... not yet
\r
109 //search from parts(2nd)
\r
110 searchPartsData(in, tmp);
\r
112 g_string_assign(out, tmp->str);
\r
116 //search from alias(2nd)
\r
117 searchAliasData(in, tmp);
\r
119 generateGlyph(tmp, out);
\r
120 if(out->len == 0) return;
\r
121 //save to cache ... not yet
\r
127 doCombine(in, out);
\r
128 if(out->len == 0) return;
\r
129 //save to cache ... not yet
\r
134 void doCombine(const GString *in, GString *out){
\r
135 GString *partIDS1, *partIDS2, *partIDS3;
\r
136 GString *partStroke1, *partStroke2, *partStroke3;
\r
139 partIDS1 = g_string_new("");
\r
140 partIDS2 = g_string_new("");
\r
141 partIDS3 = g_string_new("");
\r
142 partStroke1 = g_string_new("");
\r
143 partStroke2 = g_string_new("");
\r
144 partStroke3 = g_string_new("");
\r
146 g_string_set_size(out, 0);
\r
149 if(strncmp(in->str, "u2ff", 4) != 0) return;
\r
150 //switch by combine types
\r
151 switch((in->str)[4]){
\r
153 divideInto2(in, partIDS1, partIDS3);
\r
154 if(partIDS1->len == 0) return;
\r
156 generateGlyphByIDS(partIDS1, partStroke1, 1);
\r
157 if(partStroke1->len == 0) return;
\r
158 partStroke1 = CalcSizes(partStroke1, 0);
\r
159 generateGlyphByIDS(partIDS3, partStroke3, 2);
\r
160 if(partStroke3->len == 0) return;
\r
161 partStroke3 = CalcSizes(partStroke3, 0);
\r
164 divideInto2(in, partIDS1, partIDS3);
\r
165 if(partIDS1->len == 0) return;
\r
167 generateGlyphByIDS(partIDS1, partStroke1, 3);
\r
168 if(partStroke1->len == 0) return;
\r
169 partStroke1 = CalcSizes(partStroke1, 0);
\r
170 generateGlyphByIDS(partIDS3, partStroke3, 4);
\r
171 if(partStroke3->len == 0) return;
\r
172 partStroke3 = CalcSizes(partStroke3, 0);
\r
182 divideInto2(in, partIDS1, partIDS3);
\r
183 if(partIDS1->len == 0) return;
\r
185 generateGlyphByIDS(partIDS1, partStroke1, 5);
\r
186 if(partStroke1->len == 0) return;
\r
187 partStroke1 = CalcSizes(partStroke1, 0);
\r
188 generateGlyphByIDS(partIDS3, partStroke3, 6);
\r
189 if(partStroke3->len == 0) return;
\r
190 partStroke3 = CalcSizes(partStroke3, 0);
\r
193 divideInto3(in, partIDS1, partIDS2, partIDS3);
\r
194 if(partIDS1->len == 0) return;
\r
196 generateGlyphByIDS(partIDS1, partStroke1, 1);
\r
197 if(partStroke1->len == 0) return;
\r
198 partStroke1 = CalcSizes(partStroke1, 0);
\r
199 generateGlyphByIDS(partIDS2, partStroke2, 1);
\r
200 if(partStroke2->len == 0) return;
\r
201 partStroke2 = CalcSizes(partStroke2, 0);
\r
202 generateGlyphByIDS(partIDS3, partStroke3, 2);
\r
203 if(partStroke3->len == 0) return;
\r
204 partStroke3 = CalcSizes(partStroke3, 0);
\r
207 divideInto3(in, partIDS1, partIDS2, partIDS3);
\r
208 if(partIDS1->len == 0) return;
\r
210 generateGlyphByIDS(partIDS1, partStroke1, 3);
\r
211 if(partStroke1->len == 0) return;
\r
212 partStroke1 = CalcSizes(partStroke1, 0);
\r
213 generateGlyphByIDS(partIDS2, partStroke2, 3);
\r
214 if(partStroke2->len == 0) return;
\r
215 partStroke2 = CalcSizes(partStroke2, 0);
\r
216 generateGlyphByIDS(partIDS3, partStroke3, 4);
\r
217 if(partStroke3->len == 0) return;
\r
218 partStroke3 = CalcSizes(partStroke3, 0);
\r
221 switch((in->str)[4]){
\r
223 combineYoko2(partStroke1, partStroke3, result);
\r
226 combineTate2(partStroke1, partStroke3, result);
\r
229 combineYoko3(partStroke1, partStroke2, partStroke3, result);
\r
232 combineTate3(partStroke1, partStroke2, partStroke3, result);
\r
242 combineHame2(partStroke1, partStroke3, result);
\r
245 switch((in->str)[4]){
\r
256 addStrokeWithTransform(partStroke1, 1, result, out, 1);
\r
257 addStrokeWithTransform(partStroke3, 3, result, out, 1);
\r
261 addStrokeWithTransform(partStroke1, 1, result, out, 1);
\r
262 addStrokeWithTransform(partStroke2, 2, result, out, 1);
\r
263 addStrokeWithTransform(partStroke3, 3, result, out, 1);
\r
268 void drawGlyph(const GString *in, const int mode){
\r
271 buf = convertStroke(in->str, buf, &j);
\r
272 for(i = 0; i < j; i++){
\r
273 if(mode == 0){ //normal
\r
274 dfDrawFont(buf[i * 11 + 0],
\r
286 else if(mode == 1){ //without decoration
\r
287 dfDrawFont(buf[i * 11 + 0],
\r