summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2020-07-15 22:10:55 +0200
committerBoris Faure <billiob@gmail.com>2020-07-15 22:10:55 +0200
commit98ee7bdccabe5c33b3ef968629b258d81fbee4ec (patch)
treee85609131fe9fe1201129825fc14e0f4c44c4290
parenta56a76afc762ab8213834b503cbcf316b1dc1662 (diff)
termptydbl: be more precise on emoji as double-width
+ set all of "Misc_Pictographs" as double-width
-rw-r--r--src/bin/termptydbl.c146
-rwxr-xr-xtools/unicode_dbl_width.py9
2 files changed, 119 insertions, 36 deletions
diff --git a/src/bin/termptydbl.c b/src/bin/termptydbl.c
index 691c062..12e2c17 100644
--- a/src/bin/termptydbl.c
+++ b/src/bin/termptydbl.c
@@ -138,7 +138,6 @@ _termpty_is_ambigous_wide(Eina_Unicode g)
138 case 0x2312: EINA_FALLTHROUGH; 138 case 0x2312: EINA_FALLTHROUGH;
139 case 0x231A ... 0x231B: EINA_FALLTHROUGH; 139 case 0x231A ... 0x231B: EINA_FALLTHROUGH;
140 case 0x2328 ... 0x232A: EINA_FALLTHROUGH; 140 case 0x2328 ... 0x232A: EINA_FALLTHROUGH;
141 case 0x2388: EINA_FALLTHROUGH;
142 case 0x23CF: EINA_FALLTHROUGH; 141 case 0x23CF: EINA_FALLTHROUGH;
143 case 0x23E9 ... 0x23F3: EINA_FALLTHROUGH; 142 case 0x23E9 ... 0x23F3: EINA_FALLTHROUGH;
144 case 0x23F8 ... 0x23FA: EINA_FALLTHROUGH; 143 case 0x23F8 ... 0x23FA: EINA_FALLTHROUGH;
@@ -159,10 +158,44 @@ _termpty_is_ambigous_wide(Eina_Unicode g)
159 case 0x25E2 ... 0x25E5: EINA_FALLTHROUGH; 158 case 0x25E2 ... 0x25E5: EINA_FALLTHROUGH;
160 case 0x25EF: EINA_FALLTHROUGH; 159 case 0x25EF: EINA_FALLTHROUGH;
161 case 0x25FB ... 0x25FE: EINA_FALLTHROUGH; 160 case 0x25FB ... 0x25FE: EINA_FALLTHROUGH;
162 case 0x2600 ... 0x2612: EINA_FALLTHROUGH; 161 case 0x2600 ... 0x2606: EINA_FALLTHROUGH;
163 case 0x2614 ... 0x2685: EINA_FALLTHROUGH; 162 case 0x2609: EINA_FALLTHROUGH;
164 case 0x2690 ... 0x2705: EINA_FALLTHROUGH; 163 case 0x260E ... 0x260F: EINA_FALLTHROUGH;
165 case 0x2708 ... 0x2712: EINA_FALLTHROUGH; 164 case 0x2611: EINA_FALLTHROUGH;
165 case 0x2614 ... 0x2615: EINA_FALLTHROUGH;
166 case 0x2618: EINA_FALLTHROUGH;
167 case 0x261C ... 0x261E: EINA_FALLTHROUGH;
168 case 0x2620: EINA_FALLTHROUGH;
169 case 0x2622 ... 0x2623: EINA_FALLTHROUGH;
170 case 0x2626: EINA_FALLTHROUGH;
171 case 0x262A: EINA_FALLTHROUGH;
172 case 0x262E ... 0x262F: EINA_FALLTHROUGH;
173 case 0x2638 ... 0x263A: EINA_FALLTHROUGH;
174 case 0x2640: EINA_FALLTHROUGH;
175 case 0x2642: EINA_FALLTHROUGH;
176 case 0x2648 ... 0x2653: EINA_FALLTHROUGH;
177 case 0x265F ... 0x2661: EINA_FALLTHROUGH;
178 case 0x2663 ... 0x266A: EINA_FALLTHROUGH;
179 case 0x266C ... 0x266D: EINA_FALLTHROUGH;
180 case 0x266F: EINA_FALLTHROUGH;
181 case 0x267B: EINA_FALLTHROUGH;
182 case 0x267E ... 0x267F: EINA_FALLTHROUGH;
183 case 0x2692 ... 0x2697: EINA_FALLTHROUGH;
184 case 0x2699: EINA_FALLTHROUGH;
185 case 0x269B ... 0x269C: EINA_FALLTHROUGH;
186 case 0x269E ... 0x26A1: EINA_FALLTHROUGH;
187 case 0x26A7: EINA_FALLTHROUGH;
188 case 0x26AA ... 0x26AB: EINA_FALLTHROUGH;
189 case 0x26B0 ... 0x26B1: EINA_FALLTHROUGH;
190 case 0x26BD ... 0x26BF: EINA_FALLTHROUGH;
191 case 0x26C4 ... 0x26E1: EINA_FALLTHROUGH;
192 case 0x26E3: EINA_FALLTHROUGH;
193 case 0x26E8 ... 0x26FF: EINA_FALLTHROUGH;
194 case 0x2702: EINA_FALLTHROUGH;
195 case 0x2705: EINA_FALLTHROUGH;
196 case 0x2708 ... 0x270D: EINA_FALLTHROUGH;
197 case 0x270F: EINA_FALLTHROUGH;
198 case 0x2712: EINA_FALLTHROUGH;
166 case 0x2714: EINA_FALLTHROUGH; 199 case 0x2714: EINA_FALLTHROUGH;
167 case 0x2716: EINA_FALLTHROUGH; 200 case 0x2716: EINA_FALLTHROUGH;
168 case 0x271D: EINA_FALLTHROUGH; 201 case 0x271D: EINA_FALLTHROUGH;
@@ -176,7 +209,7 @@ _termpty_is_ambigous_wide(Eina_Unicode g)
176 case 0x274E: EINA_FALLTHROUGH; 209 case 0x274E: EINA_FALLTHROUGH;
177 case 0x2753 ... 0x2755: EINA_FALLTHROUGH; 210 case 0x2753 ... 0x2755: EINA_FALLTHROUGH;
178 case 0x2757: EINA_FALLTHROUGH; 211 case 0x2757: EINA_FALLTHROUGH;
179 case 0x2763 ... 0x2767: EINA_FALLTHROUGH; 212 case 0x2763 ... 0x2764: EINA_FALLTHROUGH;
180 case 0x2776 ... 0x277F: EINA_FALLTHROUGH; 213 case 0x2776 ... 0x277F: EINA_FALLTHROUGH;
181 case 0x2795 ... 0x2797: EINA_FALLTHROUGH; 214 case 0x2795 ... 0x2797: EINA_FALLTHROUGH;
182 case 0x27A1: EINA_FALLTHROUGH; 215 case 0x27A1: EINA_FALLTHROUGH;
@@ -199,18 +232,24 @@ _termpty_is_ambigous_wide(Eina_Unicode g)
199 case 0xFFE0 ... 0xFFE6: EINA_FALLTHROUGH; 232 case 0xFFE0 ... 0xFFE6: EINA_FALLTHROUGH;
200 case 0xFFFD: EINA_FALLTHROUGH; 233 case 0xFFFD: EINA_FALLTHROUGH;
201 case 0x16FE0 ... 0x1B2FB: EINA_FALLTHROUGH; 234 case 0x16FE0 ... 0x1B2FB: EINA_FALLTHROUGH;
202 case 0x1F000 ... 0x1F10A: EINA_FALLTHROUGH; 235 case 0x1F004: EINA_FALLTHROUGH;
203 case 0x1F10D ... 0x1F12D: EINA_FALLTHROUGH; 236 case 0x1F0CF: EINA_FALLTHROUGH;
204 case 0x1F12F ... 0x1F169: EINA_FALLTHROUGH; 237 case 0x1F100 ... 0x1F10A: EINA_FALLTHROUGH;
205 case 0x1F16C ... 0x1F1AD: EINA_FALLTHROUGH; 238 case 0x1F110 ... 0x1F12D: EINA_FALLTHROUGH;
206 case 0x1F200 ... 0x1F53D: EINA_FALLTHROUGH; 239 case 0x1F130 ... 0x1F169: EINA_FALLTHROUGH;
207 case 0x1F546 ... 0x1F64F: EINA_FALLTHROUGH; 240 case 0x1F170 ... 0x1F1AC: EINA_FALLTHROUGH;
208 case 0x1F680 ... 0x1F6FC: EINA_FALLTHROUGH; 241 case 0x1F200 ... 0x1F64F: EINA_FALLTHROUGH;
209 case 0x1F7D5 ... 0x1F7EB: EINA_FALLTHROUGH; 242 case 0x1F680 ... 0x1F6C5: EINA_FALLTHROUGH;
210 case 0x1F8B0 ... 0x1F8B1: EINA_FALLTHROUGH; 243 case 0x1F6CB ... 0x1F6D2: EINA_FALLTHROUGH;
244 case 0x1F6D5 ... 0x1F6E5: EINA_FALLTHROUGH;
245 case 0x1F6E9: EINA_FALLTHROUGH;
246 case 0x1F6EB ... 0x1F6F0: EINA_FALLTHROUGH;
247 case 0x1F6F3 ... 0x1F6FC: EINA_FALLTHROUGH;
248 case 0x1F7E0 ... 0x1F7EB: EINA_FALLTHROUGH;
211 case 0x1F90C ... 0x1F93A: EINA_FALLTHROUGH; 249 case 0x1F90C ... 0x1F93A: EINA_FALLTHROUGH;
212 case 0x1F93C ... 0x1F945: EINA_FALLTHROUGH; 250 case 0x1F93C ... 0x1F945: EINA_FALLTHROUGH;
213 case 0x1F947 ... 0x1FAD6: EINA_FALLTHROUGH; 251 case 0x1F947 ... 0x1F9FF: EINA_FALLTHROUGH;
252 case 0x1FA70 ... 0x1FAD6: EINA_FALLTHROUGH;
214 case 0x20000 ... 0x3134A: EINA_FALLTHROUGH; 253 case 0x20000 ... 0x3134A: EINA_FALLTHROUGH;
215 case 0xE0100 ... 0xE01EF: 254 case 0xE0100 ... 0xE01EF:
216 255
@@ -236,7 +275,6 @@ _termpty_is_wide(Eina_Unicode g)
236 case 0x21A9 ... 0x21AA: EINA_FALLTHROUGH; 275 case 0x21A9 ... 0x21AA: EINA_FALLTHROUGH;
237 case 0x231A ... 0x231B: EINA_FALLTHROUGH; 276 case 0x231A ... 0x231B: EINA_FALLTHROUGH;
238 case 0x2328 ... 0x232A: EINA_FALLTHROUGH; 277 case 0x2328 ... 0x232A: EINA_FALLTHROUGH;
239 case 0x2388: EINA_FALLTHROUGH;
240 case 0x23CF: EINA_FALLTHROUGH; 278 case 0x23CF: EINA_FALLTHROUGH;
241 case 0x23E9 ... 0x23F3: EINA_FALLTHROUGH; 279 case 0x23E9 ... 0x23F3: EINA_FALLTHROUGH;
242 case 0x23F8 ... 0x23FA: EINA_FALLTHROUGH; 280 case 0x23F8 ... 0x23FA: EINA_FALLTHROUGH;
@@ -245,11 +283,49 @@ _termpty_is_wide(Eina_Unicode g)
245 case 0x25B6: EINA_FALLTHROUGH; 283 case 0x25B6: EINA_FALLTHROUGH;
246 case 0x25C0: EINA_FALLTHROUGH; 284 case 0x25C0: EINA_FALLTHROUGH;
247 case 0x25FB ... 0x25FE: EINA_FALLTHROUGH; 285 case 0x25FB ... 0x25FE: EINA_FALLTHROUGH;
248 case 0x2600 ... 0x2605: EINA_FALLTHROUGH; 286 case 0x2600 ... 0x2604: EINA_FALLTHROUGH;
249 case 0x2607 ... 0x2612: EINA_FALLTHROUGH; 287 case 0x260E: EINA_FALLTHROUGH;
250 case 0x2614 ... 0x2685: EINA_FALLTHROUGH; 288 case 0x2611: EINA_FALLTHROUGH;
251 case 0x2690 ... 0x2705: EINA_FALLTHROUGH; 289 case 0x2614 ... 0x2615: EINA_FALLTHROUGH;
252 case 0x2708 ... 0x2712: EINA_FALLTHROUGH; 290 case 0x2618: EINA_FALLTHROUGH;
291 case 0x261D: EINA_FALLTHROUGH;
292 case 0x2620: EINA_FALLTHROUGH;
293 case 0x2622 ... 0x2623: EINA_FALLTHROUGH;
294 case 0x2626: EINA_FALLTHROUGH;
295 case 0x262A: EINA_FALLTHROUGH;
296 case 0x262E ... 0x262F: EINA_FALLTHROUGH;
297 case 0x2638 ... 0x263A: EINA_FALLTHROUGH;
298 case 0x2640: EINA_FALLTHROUGH;
299 case 0x2642: EINA_FALLTHROUGH;
300 case 0x2648 ... 0x2653: EINA_FALLTHROUGH;
301 case 0x265F ... 0x2660: EINA_FALLTHROUGH;
302 case 0x2663: EINA_FALLTHROUGH;
303 case 0x2665 ... 0x2666: EINA_FALLTHROUGH;
304 case 0x2668: EINA_FALLTHROUGH;
305 case 0x267B: EINA_FALLTHROUGH;
306 case 0x267E ... 0x267F: EINA_FALLTHROUGH;
307 case 0x2692 ... 0x2697: EINA_FALLTHROUGH;
308 case 0x2699: EINA_FALLTHROUGH;
309 case 0x269B ... 0x269C: EINA_FALLTHROUGH;
310 case 0x26A0 ... 0x26A1: EINA_FALLTHROUGH;
311 case 0x26A7: EINA_FALLTHROUGH;
312 case 0x26AA ... 0x26AB: EINA_FALLTHROUGH;
313 case 0x26B0 ... 0x26B1: EINA_FALLTHROUGH;
314 case 0x26BD ... 0x26BE: EINA_FALLTHROUGH;
315 case 0x26C4 ... 0x26C5: EINA_FALLTHROUGH;
316 case 0x26C8: EINA_FALLTHROUGH;
317 case 0x26CE ... 0x26CF: EINA_FALLTHROUGH;
318 case 0x26D1: EINA_FALLTHROUGH;
319 case 0x26D3 ... 0x26D4: EINA_FALLTHROUGH;
320 case 0x26E9 ... 0x26EA: EINA_FALLTHROUGH;
321 case 0x26F0 ... 0x26F5: EINA_FALLTHROUGH;
322 case 0x26F7 ... 0x26FA: EINA_FALLTHROUGH;
323 case 0x26FD: EINA_FALLTHROUGH;
324 case 0x2702: EINA_FALLTHROUGH;
325 case 0x2705: EINA_FALLTHROUGH;
326 case 0x2708 ... 0x270D: EINA_FALLTHROUGH;
327 case 0x270F: EINA_FALLTHROUGH;
328 case 0x2712: EINA_FALLTHROUGH;
253 case 0x2714: EINA_FALLTHROUGH; 329 case 0x2714: EINA_FALLTHROUGH;
254 case 0x2716: EINA_FALLTHROUGH; 330 case 0x2716: EINA_FALLTHROUGH;
255 case 0x271D: EINA_FALLTHROUGH; 331 case 0x271D: EINA_FALLTHROUGH;
@@ -262,7 +338,7 @@ _termpty_is_wide(Eina_Unicode g)
262 case 0x274E: EINA_FALLTHROUGH; 338 case 0x274E: EINA_FALLTHROUGH;
263 case 0x2753 ... 0x2755: EINA_FALLTHROUGH; 339 case 0x2753 ... 0x2755: EINA_FALLTHROUGH;
264 case 0x2757: EINA_FALLTHROUGH; 340 case 0x2757: EINA_FALLTHROUGH;
265 case 0x2763 ... 0x2767: EINA_FALLTHROUGH; 341 case 0x2763 ... 0x2764: EINA_FALLTHROUGH;
266 case 0x2795 ... 0x2797: EINA_FALLTHROUGH; 342 case 0x2795 ... 0x2797: EINA_FALLTHROUGH;
267 case 0x27A1: EINA_FALLTHROUGH; 343 case 0x27A1: EINA_FALLTHROUGH;
268 case 0x27B0: EINA_FALLTHROUGH; 344 case 0x27B0: EINA_FALLTHROUGH;
@@ -284,22 +360,24 @@ _termpty_is_wide(Eina_Unicode g)
284 case 0xFF01 ... 0xFF60: EINA_FALLTHROUGH; 360 case 0xFF01 ... 0xFF60: EINA_FALLTHROUGH;
285 case 0xFFE0 ... 0xFFE6: EINA_FALLTHROUGH; 361 case 0xFFE0 ... 0xFFE6: EINA_FALLTHROUGH;
286 case 0x16FE0 ... 0x1B2FB: EINA_FALLTHROUGH; 362 case 0x16FE0 ... 0x1B2FB: EINA_FALLTHROUGH;
287 case 0x1F000 ... 0x1F0F5: EINA_FALLTHROUGH; 363 case 0x1F004: EINA_FALLTHROUGH;
288 case 0x1F10D ... 0x1F10F: EINA_FALLTHROUGH; 364 case 0x1F0CF: EINA_FALLTHROUGH;
289 case 0x1F12F: EINA_FALLTHROUGH; 365 case 0x1F170 ... 0x1F171: EINA_FALLTHROUGH;
290 case 0x1F16C ... 0x1F171: EINA_FALLTHROUGH;
291 case 0x1F17E ... 0x1F17F: EINA_FALLTHROUGH; 366 case 0x1F17E ... 0x1F17F: EINA_FALLTHROUGH;
292 case 0x1F18E: EINA_FALLTHROUGH; 367 case 0x1F18E: EINA_FALLTHROUGH;
293 case 0x1F191 ... 0x1F19A: EINA_FALLTHROUGH; 368 case 0x1F191 ... 0x1F19A: EINA_FALLTHROUGH;
294 case 0x1F1AD: EINA_FALLTHROUGH; 369 case 0x1F200 ... 0x1F64F: EINA_FALLTHROUGH;
295 case 0x1F200 ... 0x1F53D: EINA_FALLTHROUGH; 370 case 0x1F680 ... 0x1F6C5: EINA_FALLTHROUGH;
296 case 0x1F546 ... 0x1F64F: EINA_FALLTHROUGH; 371 case 0x1F6CB ... 0x1F6D2: EINA_FALLTHROUGH;
297 case 0x1F680 ... 0x1F6FC: EINA_FALLTHROUGH; 372 case 0x1F6D5 ... 0x1F6E5: EINA_FALLTHROUGH;
298 case 0x1F7D5 ... 0x1F7EB: EINA_FALLTHROUGH; 373 case 0x1F6E9: EINA_FALLTHROUGH;
299 case 0x1F8B0 ... 0x1F8B1: EINA_FALLTHROUGH; 374 case 0x1F6EB ... 0x1F6F0: EINA_FALLTHROUGH;
375 case 0x1F6F3 ... 0x1F6FC: EINA_FALLTHROUGH;
376 case 0x1F7E0 ... 0x1F7EB: EINA_FALLTHROUGH;
300 case 0x1F90C ... 0x1F93A: EINA_FALLTHROUGH; 377 case 0x1F90C ... 0x1F93A: EINA_FALLTHROUGH;
301 case 0x1F93C ... 0x1F945: EINA_FALLTHROUGH; 378 case 0x1F93C ... 0x1F945: EINA_FALLTHROUGH;
302 case 0x1F947 ... 0x1FAD6: EINA_FALLTHROUGH; 379 case 0x1F947 ... 0x1F9FF: EINA_FALLTHROUGH;
380 case 0x1FA70 ... 0x1FAD6: EINA_FALLTHROUGH;
303 case 0x20000 ... 0x3134A: 381 case 0x20000 ... 0x3134A:
304 382
305 return EINA_TRUE; 383 return EINA_TRUE;
diff --git a/tools/unicode_dbl_width.py b/tools/unicode_dbl_width.py
index adbd936..4ba3545 100755
--- a/tools/unicode_dbl_width.py
+++ b/tools/unicode_dbl_width.py
@@ -30,9 +30,14 @@ def get_ranges(xmlfile, emoji_as_wide):
30 if not cp: 30 if not cp:
31 continue 31 continue
32 if emoji_as_wide: 32 if emoji_as_wide:
33 emoji = c.get('ExtPict') 33 ext_pic = c.get('ExtPict')
34 if emoji == 'Y': 34 emoji = c.get('Emoji')
35 if emoji == 'Y' and ext_pic == 'Y':
35 ea = 'W' 36 ea = 'W'
37 else:
38 blk = c.get('blk')
39 if blk == 'Misc_Pictographs':
40 ea = 'W'
36 41
37 cp = int(cp, 16) 42 cp = int(cp, 16)
38 if ea != r[0]: 43 if ea != r[0]: