Skip to content

Instantly share code, notes, and snippets.

@myfonj
Last active December 3, 2022 14:30
Show Gist options
  • Save myfonj/7838ae6fd49e70d874057c3506be0f8d to your computer and use it in GitHub Desktop.
Save myfonj/7838ae6fd49e70d874057c3506be0f8d to your computer and use it in GitHub Desktop.
Script measuring rendered width of Unicode characters, and its results.
[
[
106.69999694824219,
"﷽",
65021
],
[
74.19999694824219,
"𒐫",
74795
],
[
64.41667175292969,
"𒈙",
74265
],
[
60.149993896484375,
"𒐩",
74793
],
[
60.149993896484375,
"𒐪",
74794
],
[
58.26666259765625,
"𒀰",
73776
],
[
51.91667175292969,
"𒁃",
73795
],
[
50.96665954589844,
"𒁏",
73807
],
[
49.76666259765625,
"𒄦",
74022
],
[
48.83332824707031,
"𒅋",
74059
],
[
48.83332824707031,
"𒅌",
74060
],
[
48.83332824707031,
"𒅑",
74065
],
[
48,
"⸻",
11835
],
[
47.66667175292969,
"𒄡",
74017
],
[
46.133331298828125,
"𒐤",
74788
],
[
46.133331298828125,
"𒐧",
74791
],
[
46.133331298828125,
"𒐨",
74792
],
[
46.133331298828125,
"𒐮",
74798
],
[
46.133331298828125,
"𒐱",
74801
],
[
45.883331298828125,
"𒊎",
74382
],
[
45.399993896484375,
"𒍜",
74588
],
[
43.43333435058594,
"𒍳",
74611
],
[
42.75,
"𒅃",
74051
],
[
42.73333740234375,
"𒁜",
73820
],
[
42.73333740234375,
"𒁝",
73821
],
[
42.56666564941406,
"𒍙",
74585
],
[
42.100006103515625,
"𒁗",
73815
],
[
42.100006103515625,
"𒁘",
73816
],
[
42.100006103515625,
"𒁙",
73817
],
[
42.100006103515625,
"𒁚",
73818
],
[
42.100006103515625,
"𒁛",
73819
],
[
42.100006103515625,
"𒁞",
73822
],
[
42.100006103515625,
"𒁟",
73823
],
[
42.100006103515625,
"𒁠",
73824
],
[
42.100006103515625,
"𒁡",
73825
],
[
42.100006103515625,
"𒁢",
73826
],
[
42.100006103515625,
"𒁣",
73827
],
[
42.100006103515625,
"𒁤",
73828
],
[
42.100006103515625,
"𒁥",
73829
],
[
42.100006103515625,
"𒁦",
73830
],
[
42.100006103515625,
"𒁧",
73831
],
[
42.100006103515625,
"𒁨",
73832
],
[
42.100006103515625,
"𒁩",
73833
],
[
42.100006103515625,
"𒁪",
73834
],
[
42.100006103515625,
"𒁫",
73835
],
[
42.100006103515625,
"𒁬",
73836
],
[
42.100006103515625,
"𒁭",
73837
],
[
41.25,
"𒉹",
74361
],
[
41,
"ௌ",
3020
],
[
40.78334045410156,
"𒌦",
74534
],
[
40.78334045410156,
"𒌧",
74535
],
[
40.75,
"𒈓",
74259
],
[
40.616668701171875,
"𒎔",
74644
],
[
40.33332824707031,
"𒁸",
73848
],
[
39.883331298828125,
"𒆛",
74139
],
[
39.05000305175781,
"𒁎",
73806
],
[
39,
"𒀱",
73777
],
[
38.850006103515625,
"𒉛",
74331
],
[
38.33332824707031,
"൸",
3448
],
[
38.25,
"𒅉",
74057
],
[
37.73333740234375,
"𒅈",
74056
],
[
37.71665954589844,
"𒂂",
73858
],
[
37.600006103515625,
"𒈝",
74269
],
[
37.600006103515625,
"𒈱",
74289
],
[
37.600006103515625,
"𒋞",
74462
],
[
37.30000305175781,
"𒌢",
74530
],
[
37.21665954589844,
"𒈰",
74288
],
[
36.96665954589844,
"𒈗",
74263
],
[
36.96665954589844,
"𒈚",
74266
],
[
36.850006103515625,
"𒋆",
74438
],
[
36.850006103515625,
"𒋇",
74439
],
[
36.850006103515625,
"𒋈",
74440
],
[
36.850006103515625,
"𒋉",
74441
],
[
36.850006103515625,
"𒋊",
74442
],
[
36.850006103515625,
"𒋋",
74443
],
[
36.850006103515625,
"𒋌",
74444
],
[
36.850006103515625,
"𒋍",
74445
],
[
36.850006103515625,
"𒋎",
74446
],
[
36.850006103515625,
"𒋏",
74447
],
[
36.850006103515625,
"𒋐",
74448
],
[
36.850006103515625,
"𒋑",
74449
],
[
36.80000305175781,
"꧅",
43461
],
[
36.78334045410156,
"𒂀",
73856
],
[
36.75,
"𒍼",
74620
],
[
36.69999694824219,
"𒀻",
73787
],
[
36.68333435058594,
"𒈟",
74271
],
[
36.633331298828125,
"ဪ",
4138
],
[
36.383331298828125,
"𒄎",
73998
],
[
36.01666259765625,
"𒉸",
74360
],
[
35.94999694824219,
"ൌ",
3404
],
[
35.94999694824219,
"𒉃",
74307
],
[
35.93333435058594,
"꧄",
43460
],
[
35.93333435058594,
"𒌔",
74516
],
[
35.73333740234375,
"ൈ",
3400
],
[
35.649993896484375,
"𒄊",
73994
],
[
35.649993896484375,
"𒄋",
73995
],
[
35.649993896484375,
"𒄌",
73996
],
[
35.649993896484375,
"𒄍",
73997
],
[
35.649993896484375,
"𒄏",
73999
],
[
35.649993896484375,
"𒈜",
74268
],
[
35.600006103515625,
"𒅬",
74092
],
[
35.56666564941406,
"𒉯",
74351
],
[
35.08332824707031,
"ொ",
3018
],
[
35.08332824707031,
"ഐ",
3344
],
[
35.01666259765625,
"𒍖",
74582
],
[
34.96665954589844,
"൝",
3421
],
[
34.93333435058594,
"𒉰",
74352
],
[
34.93333435058594,
"𒉱",
74353
],
[
34.93333435058594,
"𒉲",
74354
],
[
34.93333435058594,
"𒉳",
74355
],
[
34.93333435058594,
"𒉴",
74356
],
[
34.93333435058594,
"𒉷",
74359
],
[
34.899993896484375,
"𒉵",
74357
],
[
34.899993896484375,
"𒉶",
74358
],
[
34.866668701171875,
"𒊾",
74430
],
[
34.71665954589844,
"𒅍",
74061
],
[
34.649993896484375,
"𒊷",
74423
],
[
34.633331298828125,
"𒊽",
74429
],
[
34.383331298828125,
"𒄐",
74000
],
[
34.149993896484375,
"𒂕",
73877
],
[
34.06666564941406,
"௵",
3061
],
[
34.05000305175781,
"𒉮",
74350
],
[
33.883331298828125,
"𒌄",
74500
],
[
33.76666259765625,
"𒃴",
73972
],
[
33.73333740234375,
"𒍘",
74584
],
[
33.68333435058594,
"𒂝",
73885
],
[
33.616668701171875,
"𒈲",
74290
],
[
33.616668701171875,
"𒈳",
74291
],
[
33.616668701171875,
"𒈴",
74292
],
[
33.616668701171875,
"𒈵",
74293
],
[
33.58332824707031,
"𒂜",
73884
],
[
33.55000305175781,
"𒉄",
74308
],
[
33.53334045410156,
"𒉨",
74344
],
[
33.51666259765625,
"𒃶",
73974
],
[
33.05000305175781,
"𒉤",
74340
],
[
33.05000305175781,
"𒉥",
74341
],
[
33.05000305175781,
"𒉦",
74342
],
[
32.94999694824219,
"𒍢",
74594
],
[
32.94999694824219,
"𒍰",
74608
],
[
32.81666564941406,
"𒀗",
73751
],
[
32.81666564941406,
"𒍫",
74603
],
[
32.81666564941406,
"𒍬",
74604
],
[
32.69999694824219,
"𒂞",
73886
],
[
32.66667175292969,
"𒆓",
74131
],
[
32.649993896484375,
"𒊐",
74384
],
[
32.633331298828125,
"𒌣",
74531
],
[
32.633331298828125,
"𒌤",
74532
],
[
32.633331298828125,
"𒌥",
74533
],
[
32.53334045410156,
"𒐇",
74759
],
[
32.51666259765625,
"ோ",
3019
],
[
32.41667175292969,
"𒉏",
74319
],
[
32.41667175292969,
"𒉐",
74320
],
[
32.41667175292969,
"𒉑",
74321
],
[
32.21665954589844,
"𒆒",
74130
],
[
32.18333435058594,
"꧃",
43459
],
[
32.149993896484375,
"𒌈",
74504
],
[
32.133331298828125,
"ஔ",
2964
],
[
32.116668701171875,
"𒊊",
74378
],
[
32.116668701171875,
"𒊋",
74379
],
[
32.116668701171875,
"𒊌",
74380
],
[
32.116668701171875,
"𒊍",
74381
],
[
32.100006103515625,
"𒐣",
74787
],
[
32.100006103515625,
"𒐥",
74789
],
[
32.100006103515625,
"𒐦",
74790
],
[
32.100006103515625,
"𒐭",
74797
],
[
32.100006103515625,
"𒐯",
74799
],
[
32.100006103515625,
"𒐰",
74800
],
[
32,
"⸺",
11834
],
[
31.966659545898438,
"𑇰",
70128
],
[
31.949996948242188,
"𒃳",
73971
],
[
31.916671752929688,
"𒄇",
73991
],
[
31.899993896484375,
"𒍯",
74607
],
[
31.75,
"ೋ",
3275
],
[
31.683334350585938,
"ൊ",
3402
],
[
31.566665649414062,
"𒂔",
73876
],
[
31.566665649414062,
"𒅅",
74053
],
[
31.466659545898438,
"௸",
3064
],
[
31.383331298828125,
"𒆶",
74166
],
[
31.23333740234375,
"𒆥",
74149
],
[
31.216659545898438,
"𒁰",
73840
],
[
31.149993896484375,
"𒃺",
73978
],
[
31.133331298828125,
"ෛ",
3547
],
[
31.083328247070312,
"𒄄",
73988
],
[
31.033340454101562,
"𒈉",
74249
],
[
31.033340454101562,
"𒈎",
74254
],
[
30.866668701171875,
"൷",
3447
],
[
30.783340454101562,
"ෞ",
3550
],
[
30.666671752929688,
"𒇸",
74232
],
[
30.633331298828125,
"𒎉",
74633
],
[
30.550003051757812,
"𒆟",
74143
],
[
30.51666259765625,
"𒇷",
74231
],
[
30.449996948242188,
"𒁉",
73801
],
[
30.449996948242188,
"𒁊",
73802
],
[
30.449996948242188,
"𒁋",
73803
],
[
30.449996948242188,
"𒁌",
73804
],
[
30.366668701171875,
"𒋤",
74468
],
[
30.316665649414062,
"𒎊",
74634
],
[
30.316665649414062,
"𒎋",
74635
],
[
30.300003051757812,
"𒆰",
74160
],
[
30.300003051757812,
"𒆱",
74161
],
[
30.26666259765625,
"𒉝",
74333
],
[
30.25,
"𒇱",
74225
],
[
30.216659545898438,
"𒁆",
73798
],
[
30.133331298828125,
"ౠ",
3168
],
[
30.133331298828125,
"𒅦",
74086
],
[
30.100006103515625,
"𒊻",
74427
],
[
30.066665649414062,
"𒄢",
74018
],
[
30.050003051757812,
"𒋚",
74458
],
[
30.01666259765625,
"𒌌",
74508
]
]
copy(JSON.stringify([...register].map(e=>{return [e[0],e[1],e[1].codePointAt(0)]}).sort((a,b)=>b[0]-a[0]),null,'\t'))
<!doctype html><html lang=""><title>
find widest Unicode characters
</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
:root { background: dimgray; color: snow; }
:link { color: aqua; } :visited { color: lime; }
</style>
<body>
<span id=winner style="tab-size: 2; -moz-tab-size: 2;"></span>
<span id=s></span>
<script>
var cp = -1;
var char;
var register = [];
var smallest = 0;
var largest = 0;
const register_limit = 100;
function done(){
console.log(register);
winner.innerHTML = register.sort((a,b)=>b[0]-a[0]).join('<br>')
}
function measureNext() {
try {
char = String.fromCodePoint(++cp)
} catch(e) {
done()
return
}
s.textContent = char;
const w = s.getBoundingClientRect().width;
if(w > 30) {
register[register.length] = [w, char];
}
if( 1 ) {
setTimeout(measureNext,0);
} else {
done();
}
}
measureNext()
/**/
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment