mplusfonts-macros 0.3.4

Procedural macros re-exported in the mplusfonts crate
Documentation
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
mod block;
mod chain;
mod cross;
mod lines;
mod shape;

use std::iter;

use swash::zeno::{Placement, Vector};

use super::GlyphMetrics;

pub use chain::{Chain, ChainList};

mod base_id {
    pub const BOX_DRAWING: u16 = 1024;
    pub const BLOCK_ELEMENTS: u16 = BOX_DRAWING + 0xB3;
    pub const BLOCK_SEXTANTS: u16 = BLOCK_ELEMENTS + 0x6D;
    pub const BLOCK_OCTANTS: u16 = BLOCK_SEXTANTS + 0x3C;
    pub const BRAILLE: u16 = BLOCK_OCTANTS + 0xE6;
}

type Image = (Vec<u8>, Placement);
type ImageCluster = Vec<Image>;
type Render = fn(&GlyphMetrics, Vector) -> ImageCluster;

pub struct GlyphDrawing {
    pub id: u16,
    pub key: char,
    pub render: Render,
}

impl GlyphDrawing {
    pub fn get(key: char) -> Option<Self> {
        let lookups = [
            Self::try_box_drawing_components,
            Self::try_block_elements,
            Self::try_block_sextants,
            Self::try_block_octants,
            Self::try_braille_patterns,
        ];

        lookups
            .into_iter()
            .zip(iter::repeat(key))
            .flat_map(|(lookup, key)| lookup(key))
            .next()
    }

    fn try_box_drawing_components(key: char) -> Option<Self> {
        let result: Option<(_, Render)> = match key {
            ..='\u{24FF}' => None,
            '\u{2500}' => Some((0x5F, lines::light_horizontal)),
            '\u{2501}' => Some((0x2F, lines::heavy_horizontal)),
            '\u{2502}' => Some((0x72, lines::light_vertical)),
            '\u{2503}' => Some((0x41, lines::heavy_vertical)),
            '\u{2504}' => Some((0x67, lines::light_triple_dash_horizontal)),
            '\u{2505}' => Some((0x36, lines::heavy_triple_dash_horizontal)),
            '\u{2506}' => Some((0x68, lines::light_triple_dash_vertical)),
            '\u{2507}' => Some((0x37, lines::heavy_triple_dash_vertical)),
            '\u{2508}' => Some((0x64, lines::light_quadruple_dash_horizontal)),
            '\u{2509}' => Some((0x33, lines::heavy_quadruple_dash_horizontal)),
            '\u{250A}' => Some((0x65, lines::light_quadruple_dash_vertical)),
            '\u{250B}' => Some((0x34, lines::heavy_quadruple_dash_vertical)),
            '\u{250C}' => Some((0x5D, lines::light_down_and_right)),
            '\u{250D}' => Some((0x20, lines::down_light_and_right_heavy)),
            '\u{250E}' => Some((0x14, lines::down_heavy_and_right_light)),
            '\u{250F}' => Some((0x2D, lines::heavy_down_and_right)),
            '\u{2510}' => Some((0x5C, lines::light_down_and_left)),
            '\u{2511}' => Some((0x1C, lines::down_light_and_left_heavy)),
            '\u{2512}' => Some((0x10, lines::down_heavy_and_left_light)),
            '\u{2513}' => Some((0x2C, lines::heavy_down_and_left)),
            '\u{2514}' => Some((0x6D, lines::light_up_and_right)),
            '\u{2515}' => Some((0x9C, lines::up_light_and_right_heavy)),
            '\u{2516}' => Some((0x90, lines::up_heavy_and_right_light)),
            '\u{2517}' => Some((0x3C, lines::heavy_up_and_right)),
            '\u{2518}' => Some((0x6C, lines::light_up_and_left)),
            '\u{2519}' => Some((0x98, lines::up_light_and_left_heavy)),
            '\u{251A}' => Some((0x8C, lines::up_heavy_and_left_light)),
            '\u{251B}' => Some((0x39, lines::heavy_up_and_left)),
            '\u{251C}' => Some((0x71, lines::light_vertical_and_right)),
            '\u{251D}' => Some((0xAE, lines::vertical_light_and_right_heavy)),
            '\u{251E}' => Some((0x8E, lines::up_heavy_and_right_down_light)),
            '\u{251F}' => Some((0x16, lines::down_heavy_and_right_up_light)),
            '\u{2520}' => Some((0xA8, lines::vertical_heavy_and_right_light)),
            '\u{2521}' => Some((0x22, lines::down_light_and_right_up_heavy)),
            '\u{2522}' => Some((0x9A, lines::up_light_and_right_down_heavy)),
            '\u{2523}' => Some((0x40, lines::heavy_vertical_and_right)),
            '\u{2524}' => Some((0x70, lines::light_vertical_and_left)),
            '\u{2525}' => Some((0xAC, lines::vertical_light_and_left_heavy)),
            '\u{2526}' => Some((0x8A, lines::up_heavy_and_left_down_light)),
            '\u{2527}' => Some((0x12, lines::down_heavy_and_left_up_light)),
            '\u{2528}' => Some((0xA6, lines::vertical_heavy_and_left_light)),
            '\u{2529}' => Some((0x1E, lines::down_light_and_left_up_heavy)),
            '\u{252A}' => Some((0x96, lines::up_light_and_left_down_heavy)),
            '\u{252B}' => Some((0x3F, lines::heavy_vertical_and_left)),
            '\u{252C}' => Some((0x5B, lines::light_down_and_horizontal)),
            '\u{252D}' => Some((0x44, lines::left_heavy_and_right_down_light)),
            '\u{252E}' => Some((0x75, lines::right_heavy_and_left_down_light)),
            '\u{252F}' => Some((0x1A, lines::down_light_and_horizontal_heavy)),
            '\u{2530}' => Some((0x0E, lines::down_heavy_and_horizontal_light)),
            '\u{2531}' => Some((0x7B, lines::right_light_and_left_down_heavy)),
            '\u{2532}' => Some((0x4A, lines::left_light_and_right_down_heavy)),
            '\u{2533}' => Some((0x2B, lines::heavy_down_and_horizontal)),
            '\u{2534}' => Some((0x6B, lines::light_up_and_horizontal)),
            '\u{2535}' => Some((0x46, lines::left_heavy_and_right_up_light)),
            '\u{2536}' => Some((0x77, lines::right_heavy_and_left_up_light)),
            '\u{2537}' => Some((0x94, lines::up_light_and_horizontal_heavy)),
            '\u{2538}' => Some((0x88, lines::up_heavy_and_horizontal_light)),
            '\u{2539}' => Some((0x7D, lines::right_light_and_left_up_heavy)),
            '\u{253A}' => Some((0x4C, lines::left_light_and_right_up_heavy)),
            '\u{253B}' => Some((0x38, lines::heavy_up_and_horizontal)),
            '\u{253C}' => Some((0x6F, lines::light_vertical_and_horizontal)),
            '\u{253D}' => Some((0x48, lines::left_heavy_and_right_vertical_light)),
            '\u{253E}' => Some((0x79, lines::right_heavy_and_left_vertical_light)),
            '\u{253F}' => Some((0xAA, lines::vertical_light_and_horizontal_heavy)),
            '\u{2540}' => Some((0x86, lines::up_heavy_and_down_horizontal_light)),
            '\u{2541}' => Some((0x18, lines::down_heavy_and_up_horizontal_light)),
            '\u{2542}' => Some((0xA4, lines::vertical_heavy_and_horizontal_light)),
            '\u{2543}' => Some((0x50, lines::left_up_heavy_and_right_down_light)),
            '\u{2544}' => Some((0x81, lines::right_up_heavy_and_left_down_light)),
            '\u{2545}' => Some((0x42, lines::left_down_heavy_and_right_up_light)),
            '\u{2546}' => Some((0x73, lines::right_down_heavy_and_left_up_light)),
            '\u{2547}' => Some((0x24, lines::down_light_and_up_horizontal_heavy)),
            '\u{2548}' => Some((0x92, lines::up_light_and_down_horizontal_heavy)),
            '\u{2549}' => Some((0x7F, lines::right_light_and_left_vertical_heavy)),
            '\u{254A}' => Some((0x4E, lines::left_light_and_right_vertical_heavy)),
            '\u{254B}' => Some((0x3E, lines::heavy_vertical_and_horizontal)),
            '\u{254C}' => Some((0x59, lines::light_double_dash_horizontal)),
            '\u{254D}' => Some((0x29, lines::heavy_double_dash_horizontal)),
            '\u{254E}' => Some((0x5A, lines::light_double_dash_vertical)),
            '\u{254F}' => Some((0x2A, lines::heavy_double_dash_vertical)),
            '\u{2550}' => Some((0x03, lines::double_horizontal)),
            '\u{2551}' => Some((0x0A, lines::double_vertical)),
            '\u{2552}' => Some((0x28, lines::down_single_and_right_double)),
            '\u{2553}' => Some((0x0D, lines::down_double_and_right_single)),
            '\u{2554}' => Some((0x02, lines::double_down_and_right)),
            '\u{2555}' => Some((0x27, lines::down_single_and_left_double)),
            '\u{2556}' => Some((0x0C, lines::down_double_and_left_single)),
            '\u{2557}' => Some((0x01, lines::double_down_and_left)),
            '\u{2558}' => Some((0xA0, lines::up_single_and_right_double)),
            '\u{2559}' => Some((0x85, lines::up_double_and_right_single)),
            '\u{255A}' => Some((0x06, lines::double_up_and_right)),
            '\u{255B}' => Some((0x9F, lines::up_single_and_left_double)),
            '\u{255C}' => Some((0x84, lines::up_double_and_left_single)),
            '\u{255D}' => Some((0x05, lines::double_up_and_left)),
            '\u{255E}' => Some((0xB2, lines::vertical_single_and_right_double)),
            '\u{255F}' => Some((0xA3, lines::vertical_double_and_right_single)),
            '\u{2560}' => Some((0x09, lines::double_vertical_and_right)),
            '\u{2561}' => Some((0xB1, lines::vertical_single_and_left_double)),
            '\u{2562}' => Some((0xA2, lines::vertical_double_and_left_single)),
            '\u{2563}' => Some((0x08, lines::double_vertical_and_left)),
            '\u{2564}' => Some((0x26, lines::down_single_and_horizontal_double)),
            '\u{2565}' => Some((0x0B, lines::down_double_and_horizontal_single)),
            '\u{2566}' => Some((0x00, lines::double_down_and_horizontal)),
            '\u{2567}' => Some((0x9E, lines::up_single_and_horizontal_double)),
            '\u{2568}' => Some((0x83, lines::up_double_and_horizontal_single)),
            '\u{2569}' => Some((0x04, lines::double_up_and_horizontal)),
            '\u{256A}' => Some((0xB0, lines::vertical_single_and_horizontal_double)),
            '\u{256B}' => Some((0xA1, lines::vertical_double_and_horizontal_single)),
            '\u{256C}' => Some((0x07, lines::double_vertical_and_horizontal)),
            '\u{256D}' => Some((0x53, lines::light_arc_down_and_right)),
            '\u{256E}' => Some((0x52, lines::light_arc_down_and_left)),
            '\u{256F}' => Some((0x54, lines::light_arc_up_and_left)),
            '\u{2570}' => Some((0x55, lines::light_arc_up_and_right)),
            '\u{2571}' => Some((0x58, cross::light_diagonal_upper_right_to_lower_left)),
            '\u{2572}' => Some((0x57, cross::light_diagonal_upper_left_to_lower_right)),
            '\u{2573}' => Some((0x56, cross::light_diagonal_cross)),
            '\u{2574}' => Some((0x63, lines::light_left)),
            '\u{2575}' => Some((0x6E, lines::light_up)),
            '\u{2576}' => Some((0x66, lines::light_right)),
            '\u{2577}' => Some((0x5E, lines::light_down)),
            '\u{2578}' => Some((0x32, lines::heavy_left)),
            '\u{2579}' => Some((0x3D, lines::heavy_up)),
            '\u{257A}' => Some((0x35, lines::heavy_right)),
            '\u{257B}' => Some((0x2E, lines::heavy_down)),
            '\u{257C}' => Some((0x61, lines::light_left_and_heavy_right)),
            '\u{257D}' => Some((0x69, lines::light_up_and_heavy_down)),
            '\u{257E}' => Some((0x30, lines::heavy_left_and_light_right)),
            '\u{257F}' => Some((0x3A, lines::heavy_up_and_light_down)),
            '\u{2580}'..='\u{D7FF}' | '\u{E000}'..='\u{1FBAE}' => None,
            '\u{1FBAF}' => Some((0x60, lines::light_horizontal_with_vertical_stroke)),
            '\u{1FBB0}'.. => None,
        };

        result.map(|(id_offset, render)| Self {
            id: base_id::BOX_DRAWING + id_offset,
            key,
            render,
        })
    }

    #[rustfmt::skip]
    fn try_block_elements(key: char) -> Option<Self> {
        let result: Option<(_, Render)> = match key {
            ..='\u{257F}' => None,
            '\u{2580}' => Some((0x55, block::upper_half_block)),
            '\u{2581}' => Some((0x2C, block::lower_one_eighth_block)),
            '\u{2582}' => Some((0x2D, block::lower_one_quarter_block)),
            '\u{2583}' => Some((0x30, block::lower_three_eighths_block)),
            '\u{2584}' => Some((0x23, block::lower_half_block)),
            '\u{2585}' => Some((0x22, block::lower_five_eighths_block)),
            '\u{2586}' => Some((0x31, block::lower_three_quarters_block)),
            '\u{2587}' => Some((0x2F, block::lower_seven_eighths_block)),
            '\u{2588}' => Some((0x02, block::full_block)),
            '\u{2589}' => Some((0x18, block::left_seven_eighths_block)),
            '\u{258A}' => Some((0x1A, block::left_three_quarters_block)),
            '\u{258B}' => Some((0x0F, block::left_five_eighths_block)),
            '\u{258C}' => Some((0x10, block::left_half_block)),
            '\u{258D}' => Some((0x19, block::left_three_eighths_block)),
            '\u{258E}' => Some((0x16, block::left_one_quarter_block)),
            '\u{258F}' => Some((0x15, block::left_one_eighth_block)),
            '\u{2590}' => Some((0x44, block::right_half_block)),
            '\u{2591}' => Some((0x1E, block::light_shade)),
            '\u{2592}' => Some((0x34, block::medium_shade)),
            '\u{2593}' => Some((0x01, block::dark_shade)),
            '\u{2594}' => Some((0x5F, block::upper_one_eighth_block)),
            '\u{2595}' => Some((0x48, block::right_one_eighth_block)),
            '\u{2596}' => Some((0x37, block::quadrant_lower_left)),
            '\u{2597}' => Some((0x38, block::quadrant_lower_right)),
            '\u{2598}' => Some((0x3D, block::quadrant_upper_left)),
            '\u{2599}' => Some((0x39, block::quadrant_upper_left_and_lower_left_and_lower_right)),
            '\u{259A}' => Some((0x3A, block::quadrant_upper_left_and_lower_right)),
            '\u{259B}' => Some((0x3B, block::quadrant_upper_left_and_upper_right_and_lower_left)),
            '\u{259C}' => Some((0x3C, block::quadrant_upper_left_and_upper_right_and_lower_right)),
            '\u{259D}' => Some((0x40, block::quadrant_upper_right)),
            '\u{259E}' => Some((0x3F, block::quadrant_upper_right_and_lower_left)),
            '\u{259F}' => Some((0x3E, block::quadrant_upper_right_and_lower_left_and_lower_right)),
            '\u{25A0}'..='\u{D7FF}' | '\u{E000}'..='\u{1CE8F}' => None,
            '\u{1CE90}' => Some((0x5A, block::upper_left_one_sixteenth_block)),
            '\u{1CE91}' => Some((0x50, block::upper_centre_left_one_sixteenth_block)),
            '\u{1CE92}' => Some((0x52, block::upper_centre_right_one_sixteenth_block)),
            '\u{1CE93}' => Some((0x61, block::upper_right_one_sixteenth_block)),
            '\u{1CE94}' => Some((0x5D, block::upper_middle_left_one_sixteenth_block)),
            '\u{1CE95}' => Some((0x5B, block::upper_middle_centre_left_one_sixteenth_block)),
            '\u{1CE96}' => Some((0x5C, block::upper_middle_centre_right_one_sixteenth_block)),
            '\u{1CE97}' => Some((0x5E, block::upper_middle_right_one_sixteenth_block)),
            '\u{1CE98}' => Some((0x2A, block::lower_middle_left_one_sixteenth_block)),
            '\u{1CE99}' => Some((0x28, block::lower_middle_centre_left_one_sixteenth_block)),
            '\u{1CE9A}' => Some((0x29, block::lower_middle_centre_right_one_sixteenth_block)),
            '\u{1CE9B}' => Some((0x2B, block::lower_middle_right_one_sixteenth_block)),
            '\u{1CE9C}' => Some((0x27, block::lower_left_one_sixteenth_block)),
            '\u{1CE9D}' => Some((0x1F, block::lower_centre_left_one_sixteenth_block)),
            '\u{1CE9E}' => Some((0x21, block::lower_centre_right_one_sixteenth_block)),
            '\u{1CE9F}' => Some((0x2E, block::lower_right_one_sixteenth_block)),
            '\u{1CEA0}' => Some((0x45, block::right_half_lower_one_quarter_block)),
            '\u{1CEA1}' => Some((0x4D, block::right_three_quarters_lower_one_quarter_block)),
            '\u{1CEA2}' => Some((0x1B, block::left_three_quarters_lower_one_quarter_block)),
            '\u{1CEA3}' => Some((0x12, block::left_half_lower_one_quarter_block)),
            '\u{1CEA4}' => Some((0x24, block::lower_half_left_one_quarter_block)),
            '\u{1CEA5}' => Some((0x32, block::lower_three_quarters_left_one_quarter_block)),
            '\u{1CEA6}' => Some((0x65, block::upper_three_quarters_left_one_quarter_block)),
            '\u{1CEA7}' => Some((0x57, block::upper_half_left_one_quarter_block)),
            '\u{1CEA8}' => Some((0x14, block::left_half_upper_one_quarter_block)),
            '\u{1CEA9}' => Some((0x1C, block::left_three_quarters_upper_one_quarter_block)),
            '\u{1CEAA}' => Some((0x4E, block::right_three_quarters_upper_one_quarter_block)),
            '\u{1CEAB}' => Some((0x47, block::right_half_upper_one_quarter_block)),
            '\u{1CEAC}' => Some((0x59, block::upper_half_right_one_quarter_block)),
            '\u{1CEAD}' => Some((0x66, block::upper_three_quarters_right_one_quarter_block)),
            '\u{1CEAE}' => Some((0x33, block::lower_three_quarters_right_one_quarter_block)),
            '\u{1CEAF}' => Some((0x26, block::lower_half_right_one_quarter_block)),
            '\u{1CEB0}'..='\u{1FB6F}' => None,
            '\u{1FB70}' => Some((0x67, block::vertical_one_eighth_block_2)),
            '\u{1FB71}' => Some((0x68, block::vertical_one_eighth_block_3)),
            '\u{1FB72}' => Some((0x69, block::vertical_one_eighth_block_4)),
            '\u{1FB73}' => Some((0x6A, block::vertical_one_eighth_block_5)),
            '\u{1FB74}' => Some((0x6B, block::vertical_one_eighth_block_6)),
            '\u{1FB75}' => Some((0x6C, block::vertical_one_eighth_block_7)),
            '\u{1FB76}' => Some((0x05, block::horizontal_one_eighth_block_2)),
            '\u{1FB77}' => Some((0x06, block::horizontal_one_eighth_block_3)),
            '\u{1FB78}' => Some((0x07, block::horizontal_one_eighth_block_4)),
            '\u{1FB79}' => Some((0x08, block::horizontal_one_eighth_block_5)),
            '\u{1FB7A}' => Some((0x09, block::horizontal_one_eighth_block_6)),
            '\u{1FB7B}' => Some((0x0A, block::horizontal_one_eighth_block_7)),
            '\u{1FB7C}' => Some((0x0D, block::left_and_lower_one_eighth_block)),
            '\u{1FB7D}' => Some((0x0E, block::left_and_upper_one_eighth_block)),
            '\u{1FB7E}' => Some((0x42, block::right_and_upper_one_eighth_block)),
            '\u{1FB7F}' => Some((0x41, block::right_and_lower_one_eighth_block)),
            '\u{1FB80}' => Some((0x4F, block::upper_and_lower_one_eighth_block)),
            '\u{1FB81}' => Some((0x04, block::horizontal_one_eighth_block_1358)),
            '\u{1FB82}' => Some((0x60, block::upper_one_quarter_block)),
            '\u{1FB83}' => Some((0x63, block::upper_three_eighths_block)),
            '\u{1FB84}' => Some((0x53, block::upper_five_eighths_block)),
            '\u{1FB85}' => Some((0x64, block::upper_three_quarters_block)),
            '\u{1FB86}' => Some((0x62, block::upper_seven_eighths_block)),
            '\u{1FB87}' => Some((0x49, block::right_one_quarter_block)),
            '\u{1FB88}' => Some((0x4B, block::right_three_eighths_block)),
            '\u{1FB89}' => Some((0x43, block::right_five_eighths_block)),
            '\u{1FB8A}' => Some((0x4C, block::right_three_quarters_block)),
            '\u{1FB8B}' => Some((0x4A, block::right_seven_eighths_block)),
            '\u{1FB8C}' => Some((0x13, block::left_half_medium_shade)),
            '\u{1FB8D}' => Some((0x46, block::right_half_medium_shade)),
            '\u{1FB8E}' => Some((0x58, block::upper_half_medium_shade)),
            '\u{1FB8F}' => Some((0x25, block::lower_half_medium_shade)),
            '\u{1FB90}' => Some((0x0C, block::inverse_medium_shade)),
            '\u{1FB91}' => Some((0x54, block::upper_half_block_and_lower_half_inverse_medium_shade)),
            '\u{1FB92}' => Some((0x56, block::upper_half_inverse_medium_shade_and_lower_half_block)),
            '\u{1FB93}' => None,
            '\u{1FB94}' => Some((0x11, block::left_half_inverse_medium_shade_and_right_half_block)),
            '\u{1FB95}' => Some((0x00, block::checker_board_fill)),
            '\u{1FB96}' => Some((0x0B, block::inverse_checker_board_fill)),
            '\u{1FB97}' => Some((0x03, block::heavy_horizontal_fill)),
            '\u{1FB98}'..='\u{1FBCD}' => None,
            '\u{1FBCE}' => Some((0x1D, block::left_two_thirds_block)),
            '\u{1FBCF}' => Some((0x17, block::left_one_third_block)),
            '\u{1FBD0}'..='\u{1FBE3}' => None,
            '\u{1FBE4}' => Some((0x51, block::upper_centre_one_quarter_block)),
            '\u{1FBE5}' => Some((0x20, block::lower_centre_one_quarter_block)),
            '\u{1FBE6}' => Some((0x35, block::middle_left_one_quarter_block)),
            '\u{1FBE7}' => Some((0x36, block::middle_right_one_quarter_block)),
            '\u{1FBE8}'.. => None,
        };

        result.map(|(id_offset, render)| Self {
            id: base_id::BLOCK_ELEMENTS + id_offset,
            key,
            render,
        })
    }

    fn try_block_sextants(key: char) -> Option<Self> {
        let result: Option<(_, Render)> = match key {
            ..='\u{1FAFF}' => None,
            '\u{1FB00}' => Some((0x00, block::block_sextant_1)),
            '\u{1FB01}' => Some((0x1E, block::block_sextant_2)),
            '\u{1FB02}' => Some((0x01, block::block_sextant_12)),
            '\u{1FB03}' => Some((0x2D, block::block_sextant_3)),
            '\u{1FB04}' => Some((0x10, block::block_sextant_13)),
            '\u{1FB05}' => Some((0x1F, block::block_sextant_23)),
            '\u{1FB06}' => Some((0x02, block::block_sextant_123)),
            '\u{1FB07}' => Some((0x35, block::block_sextant_4)),
            '\u{1FB08}' => Some((0x17, block::block_sextant_14)),
            '\u{1FB09}' => Some((0x27, block::block_sextant_24)),
            '\u{1FB0A}' => Some((0x09, block::block_sextant_124)),
            '\u{1FB0B}' => Some((0x2E, block::block_sextant_34)),
            '\u{1FB0C}' => Some((0x11, block::block_sextant_134)),
            '\u{1FB0D}' => Some((0x20, block::block_sextant_234)),
            '\u{1FB0E}' => Some((0x03, block::block_sextant_1234)),
            '\u{1FB0F}' => Some((0x39, block::block_sextant_5)),
            '\u{1FB10}' => Some((0x1B, block::block_sextant_15)),
            '\u{1FB11}' => Some((0x2A, block::block_sextant_25)),
            '\u{1FB12}' => Some((0x0D, block::block_sextant_125)),
            '\u{1FB13}' => Some((0x32, block::block_sextant_35)),
            '\u{1FB14}' => Some((0x24, block::block_sextant_235)),
            '\u{1FB15}' => Some((0x06, block::block_sextant_1235)),
            '\u{1FB16}' => Some((0x36, block::block_sextant_45)),
            '\u{1FB17}' => Some((0x18, block::block_sextant_145)),
            '\u{1FB18}' => Some((0x28, block::block_sextant_245)),
            '\u{1FB19}' => Some((0x0A, block::block_sextant_1245)),
            '\u{1FB1A}' => Some((0x2F, block::block_sextant_345)),
            '\u{1FB1B}' => Some((0x12, block::block_sextant_1345)),
            '\u{1FB1C}' => Some((0x21, block::block_sextant_2345)),
            '\u{1FB1D}' => Some((0x04, block::block_sextant_12345)),
            '\u{1FB1E}' => Some((0x3B, block::block_sextant_6)),
            '\u{1FB1F}' => Some((0x1D, block::block_sextant_16)),
            '\u{1FB20}' => Some((0x2C, block::block_sextant_26)),
            '\u{1FB21}' => Some((0x0F, block::block_sextant_126)),
            '\u{1FB22}' => Some((0x34, block::block_sextant_36)),
            '\u{1FB23}' => Some((0x16, block::block_sextant_136)),
            '\u{1FB24}' => Some((0x26, block::block_sextant_236)),
            '\u{1FB25}' => Some((0x08, block::block_sextant_1236)),
            '\u{1FB26}' => Some((0x38, block::block_sextant_46)),
            '\u{1FB27}' => Some((0x1A, block::block_sextant_146)),
            '\u{1FB28}' => Some((0x0C, block::block_sextant_1246)),
            '\u{1FB29}' => Some((0x31, block::block_sextant_346)),
            '\u{1FB2A}' => Some((0x14, block::block_sextant_1346)),
            '\u{1FB2B}' => Some((0x23, block::block_sextant_2346)),
            '\u{1FB2C}' => Some((0x05, block::block_sextant_12346)),
            '\u{1FB2D}' => Some((0x3A, block::block_sextant_56)),
            '\u{1FB2E}' => Some((0x1C, block::block_sextant_156)),
            '\u{1FB2F}' => Some((0x2B, block::block_sextant_256)),
            '\u{1FB30}' => Some((0x0E, block::block_sextant_1256)),
            '\u{1FB31}' => Some((0x33, block::block_sextant_356)),
            '\u{1FB32}' => Some((0x15, block::block_sextant_1356)),
            '\u{1FB33}' => Some((0x25, block::block_sextant_2356)),
            '\u{1FB34}' => Some((0x07, block::block_sextant_12356)),
            '\u{1FB35}' => Some((0x37, block::block_sextant_456)),
            '\u{1FB36}' => Some((0x19, block::block_sextant_1456)),
            '\u{1FB37}' => Some((0x29, block::block_sextant_2456)),
            '\u{1FB38}' => Some((0x0B, block::block_sextant_12456)),
            '\u{1FB39}' => Some((0x30, block::block_sextant_3456)),
            '\u{1FB3A}' => Some((0x13, block::block_sextant_13456)),
            '\u{1FB3B}' => Some((0x22, block::block_sextant_23456)),
            '\u{1FB3C}'.. => None,
        };

        result.map(|(id_offset, render)| Self {
            id: base_id::BLOCK_SEXTANTS + id_offset,
            key,
            render,
        })
    }

    fn try_block_octants(key: char) -> Option<Self> {
        let result: Option<(_, Render)> = match key {
            ..='\u{1CCFF}' => None,
            '\u{1CD00}' => Some((0xB0, block::block_octant_3)),
            '\u{1CD01}' => Some((0x75, block::block_octant_23)),
            '\u{1CD02}' => Some((0x00, block::block_octant_123)),
            '\u{1CD03}' => Some((0xCE, block::block_octant_4)),
            '\u{1CD04}' => Some((0x56, block::block_octant_14)),
            '\u{1CD05}' => Some((0x1B, block::block_octant_124)),
            '\u{1CD06}' => Some((0xB1, block::block_octant_34)),
            '\u{1CD07}' => Some((0x3A, block::block_octant_134)),
            '\u{1CD08}' => Some((0x76, block::block_octant_234)),
            '\u{1CD09}' => Some((0xDD, block::block_octant_5)),
            '\u{1CD0A}' => Some((0x66, block::block_octant_15)),
            '\u{1CD0B}' => Some((0xA1, block::block_octant_25)),
            '\u{1CD0C}' => Some((0x2B, block::block_octant_125)),
            '\u{1CD0D}' => Some((0x4A, block::block_octant_135)),
            '\u{1CD0E}' => Some((0x86, block::block_octant_235)),
            '\u{1CD0F}' => Some((0x0C, block::block_octant_1235)),
            '\u{1CD10}' => Some((0xCF, block::block_octant_45)),
            '\u{1CD11}' => Some((0x57, block::block_octant_145)),
            '\u{1CD12}' => Some((0x95, block::block_octant_245)),
            '\u{1CD13}' => Some((0x1C, block::block_octant_1245)),
            '\u{1CD14}' => Some((0xB2, block::block_octant_345)),
            '\u{1CD15}' => Some((0x3B, block::block_octant_1345)),
            '\u{1CD16}' => Some((0x77, block::block_octant_2345)),
            '\u{1CD17}' => Some((0x01, block::block_octant_12345)),
            '\u{1CD18}' => Some((0xE3, block::block_octant_6)),
            '\u{1CD19}' => Some((0x6E, block::block_octant_16)),
            '\u{1CD1A}' => Some((0xA9, block::block_octant_26)),
            '\u{1CD1B}' => Some((0x33, block::block_octant_126)),
            '\u{1CD1C}' => Some((0xC7, block::block_octant_36)),
            '\u{1CD1D}' => Some((0x50, block::block_octant_136)),
            '\u{1CD1E}' => Some((0x8E, block::block_octant_236)),
            '\u{1CD1F}' => Some((0x14, block::block_octant_1236)),
            '\u{1CD20}' => Some((0x5F, block::block_octant_146)),
            '\u{1CD21}' => Some((0x9B, block::block_octant_246)),
            '\u{1CD22}' => Some((0x24, block::block_octant_1246)),
            '\u{1CD23}' => Some((0xB9, block::block_octant_346)),
            '\u{1CD24}' => Some((0x43, block::block_octant_1346)),
            '\u{1CD25}' => Some((0x7F, block::block_octant_2346)),
            '\u{1CD26}' => Some((0x06, block::block_octant_12346)),
            '\u{1CD27}' => Some((0xDE, block::block_octant_56)),
            '\u{1CD28}' => Some((0x67, block::block_octant_156)),
            '\u{1CD29}' => Some((0xA2, block::block_octant_256)),
            '\u{1CD2A}' => Some((0x2C, block::block_octant_1256)),
            '\u{1CD2B}' => Some((0xC0, block::block_octant_356)),
            '\u{1CD2C}' => Some((0x4B, block::block_octant_1356)),
            '\u{1CD2D}' => Some((0x87, block::block_octant_2356)),
            '\u{1CD2E}' => Some((0x0D, block::block_octant_12356)),
            '\u{1CD2F}' => Some((0xD0, block::block_octant_456)),
            '\u{1CD30}' => Some((0x58, block::block_octant_1456)),
            '\u{1CD31}' => Some((0x96, block::block_octant_2456)),
            '\u{1CD32}' => Some((0x1D, block::block_octant_12456)),
            '\u{1CD33}' => Some((0xB3, block::block_octant_3456)),
            '\u{1CD34}' => Some((0x3C, block::block_octant_13456)),
            '\u{1CD35}' => Some((0x78, block::block_octant_23456)),
            '\u{1CD36}' => Some((0x72, block::block_octant_17)),
            '\u{1CD37}' => Some((0xAD, block::block_octant_27)),
            '\u{1CD38}' => Some((0x37, block::block_octant_127)),
            '\u{1CD39}' => Some((0xCB, block::block_octant_37)),
            '\u{1CD3A}' => Some((0x53, block::block_octant_137)),
            '\u{1CD3B}' => Some((0x92, block::block_octant_237)),
            '\u{1CD3C}' => Some((0x18, block::block_octant_1237)),
            '\u{1CD3D}' => Some((0xDA, block::block_octant_47)),
            '\u{1CD3E}' => Some((0x63, block::block_octant_147)),
            '\u{1CD3F}' => Some((0x9E, block::block_octant_247)),
            '\u{1CD40}' => Some((0x28, block::block_octant_1247)),
            '\u{1CD41}' => Some((0xBD, block::block_octant_347)),
            '\u{1CD42}' => Some((0x47, block::block_octant_1347)),
            '\u{1CD43}' => Some((0x83, block::block_octant_2347)),
            '\u{1CD44}' => Some((0x09, block::block_octant_12347)),
            '\u{1CD45}' => Some((0x6B, block::block_octant_157)),
            '\u{1CD46}' => Some((0xA6, block::block_octant_257)),
            '\u{1CD47}' => Some((0x30, block::block_octant_1257)),
            '\u{1CD48}' => Some((0xC4, block::block_octant_357)),
            '\u{1CD49}' => Some((0x8B, block::block_octant_2357)),
            '\u{1CD4A}' => Some((0x11, block::block_octant_12357)),
            '\u{1CD4B}' => Some((0xD4, block::block_octant_457)),
            '\u{1CD4C}' => Some((0x5C, block::block_octant_1457)),
            '\u{1CD4D}' => Some((0x21, block::block_octant_12457)),
            '\u{1CD4E}' => Some((0xB6, block::block_octant_3457)),
            '\u{1CD4F}' => Some((0x40, block::block_octant_13457)),
            '\u{1CD50}' => Some((0x7C, block::block_octant_23457)),
            '\u{1CD51}' => Some((0xE4, block::block_octant_67)),
            '\u{1CD52}' => Some((0x6F, block::block_octant_167)),
            '\u{1CD53}' => Some((0xAA, block::block_octant_267)),
            '\u{1CD54}' => Some((0x34, block::block_octant_1267)),
            '\u{1CD55}' => Some((0xC8, block::block_octant_367)),
            '\u{1CD56}' => Some((0x51, block::block_octant_1367)),
            '\u{1CD57}' => Some((0x8F, block::block_octant_2367)),
            '\u{1CD58}' => Some((0x15, block::block_octant_12367)),
            '\u{1CD59}' => Some((0xD7, block::block_octant_467)),
            '\u{1CD5A}' => Some((0x60, block::block_octant_1467)),
            '\u{1CD5B}' => Some((0x9C, block::block_octant_2467)),
            '\u{1CD5C}' => Some((0x25, block::block_octant_12467)),
            '\u{1CD5D}' => Some((0xBA, block::block_octant_3467)),
            '\u{1CD5E}' => Some((0x44, block::block_octant_13467)),
            '\u{1CD5F}' => Some((0x80, block::block_octant_23467)),
            '\u{1CD60}' => Some((0x07, block::block_octant_123467)),
            '\u{1CD61}' => Some((0xDF, block::block_octant_567)),
            '\u{1CD62}' => Some((0x68, block::block_octant_1567)),
            '\u{1CD63}' => Some((0xA3, block::block_octant_2567)),
            '\u{1CD64}' => Some((0x2D, block::block_octant_12567)),
            '\u{1CD65}' => Some((0xC1, block::block_octant_3567)),
            '\u{1CD66}' => Some((0x4C, block::block_octant_13567)),
            '\u{1CD67}' => Some((0x88, block::block_octant_23567)),
            '\u{1CD68}' => Some((0x0E, block::block_octant_123567)),
            '\u{1CD69}' => Some((0xD1, block::block_octant_4567)),
            '\u{1CD6A}' => Some((0x59, block::block_octant_14567)),
            '\u{1CD6B}' => Some((0x97, block::block_octant_24567)),
            '\u{1CD6C}' => Some((0x1E, block::block_octant_124567)),
            '\u{1CD6D}' => Some((0xB4, block::block_octant_34567)),
            '\u{1CD6E}' => Some((0x3D, block::block_octant_134567)),
            '\u{1CD6F}' => Some((0x79, block::block_octant_234567)),
            '\u{1CD70}' => Some((0x02, block::block_octant_1234567)),
            '\u{1CD71}' => Some((0x74, block::block_octant_18)),
            '\u{1CD72}' => Some((0xAF, block::block_octant_28)),
            '\u{1CD73}' => Some((0x39, block::block_octant_128)),
            '\u{1CD74}' => Some((0xCD, block::block_octant_38)),
            '\u{1CD75}' => Some((0x55, block::block_octant_138)),
            '\u{1CD76}' => Some((0x94, block::block_octant_238)),
            '\u{1CD77}' => Some((0x1A, block::block_octant_1238)),
            '\u{1CD78}' => Some((0xDC, block::block_octant_48)),
            '\u{1CD79}' => Some((0x65, block::block_octant_148)),
            '\u{1CD7A}' => Some((0xA0, block::block_octant_248)),
            '\u{1CD7B}' => Some((0x2A, block::block_octant_1248)),
            '\u{1CD7C}' => Some((0xBF, block::block_octant_348)),
            '\u{1CD7D}' => Some((0x49, block::block_octant_1348)),
            '\u{1CD7E}' => Some((0x85, block::block_octant_2348)),
            '\u{1CD7F}' => Some((0x0B, block::block_octant_12348)),
            '\u{1CD80}' => Some((0xE2, block::block_octant_58)),
            '\u{1CD81}' => Some((0x6D, block::block_octant_158)),
            '\u{1CD82}' => Some((0xA8, block::block_octant_258)),
            '\u{1CD83}' => Some((0x32, block::block_octant_1258)),
            '\u{1CD84}' => Some((0xC6, block::block_octant_358)),
            '\u{1CD85}' => Some((0x4F, block::block_octant_1358)),
            '\u{1CD86}' => Some((0x8D, block::block_octant_2358)),
            '\u{1CD87}' => Some((0x13, block::block_octant_12358)),
            '\u{1CD88}' => Some((0xD6, block::block_octant_458)),
            '\u{1CD89}' => Some((0x5E, block::block_octant_1458)),
            '\u{1CD8A}' => Some((0x9A, block::block_octant_2458)),
            '\u{1CD8B}' => Some((0x23, block::block_octant_12458)),
            '\u{1CD8C}' => Some((0xB8, block::block_octant_3458)),
            '\u{1CD8D}' => Some((0x42, block::block_octant_13458)),
            '\u{1CD8E}' => Some((0x7E, block::block_octant_23458)),
            '\u{1CD8F}' => Some((0x05, block::block_octant_123458)),
            '\u{1CD90}' => Some((0x71, block::block_octant_168)),
            '\u{1CD91}' => Some((0xAC, block::block_octant_268)),
            '\u{1CD92}' => Some((0x36, block::block_octant_1268)),
            '\u{1CD93}' => Some((0xCA, block::block_octant_368)),
            '\u{1CD94}' => Some((0x91, block::block_octant_2368)),
            '\u{1CD95}' => Some((0x17, block::block_octant_12368)),
            '\u{1CD96}' => Some((0xD9, block::block_octant_468)),
            '\u{1CD97}' => Some((0x62, block::block_octant_1468)),
            '\u{1CD98}' => Some((0x27, block::block_octant_12468)),
            '\u{1CD99}' => Some((0xBC, block::block_octant_3468)),
            '\u{1CD9A}' => Some((0x46, block::block_octant_13468)),
            '\u{1CD9B}' => Some((0x82, block::block_octant_23468)),
            '\u{1CD9C}' => Some((0xE0, block::block_octant_568)),
            '\u{1CD9D}' => Some((0x6A, block::block_octant_1568)),
            '\u{1CD9E}' => Some((0xA5, block::block_octant_2568)),
            '\u{1CD9F}' => Some((0x2F, block::block_octant_12568)),
            '\u{1CDA0}' => Some((0xC3, block::block_octant_3568)),
            '\u{1CDA1}' => Some((0x4D, block::block_octant_13568)),
            '\u{1CDA2}' => Some((0x8A, block::block_octant_23568)),
            '\u{1CDA3}' => Some((0x10, block::block_octant_123568)),
            '\u{1CDA4}' => Some((0xD3, block::block_octant_4568)),
            '\u{1CDA5}' => Some((0x5B, block::block_octant_14568)),
            '\u{1CDA6}' => Some((0x98, block::block_octant_24568)),
            '\u{1CDA7}' => Some((0x20, block::block_octant_124568)),
            '\u{1CDA8}' => Some((0xB5, block::block_octant_34568)),
            '\u{1CDA9}' => Some((0x3F, block::block_octant_134568)),
            '\u{1CDAA}' => Some((0x7B, block::block_octant_234568)),
            '\u{1CDAB}' => Some((0x03, block::block_octant_1234568)),
            '\u{1CDAC}' => Some((0x73, block::block_octant_178)),
            '\u{1CDAD}' => Some((0xAE, block::block_octant_278)),
            '\u{1CDAE}' => Some((0x38, block::block_octant_1278)),
            '\u{1CDAF}' => Some((0xCC, block::block_octant_378)),
            '\u{1CDB0}' => Some((0x54, block::block_octant_1378)),
            '\u{1CDB1}' => Some((0x93, block::block_octant_2378)),
            '\u{1CDB2}' => Some((0x19, block::block_octant_12378)),
            '\u{1CDB3}' => Some((0xDB, block::block_octant_478)),
            '\u{1CDB4}' => Some((0x64, block::block_octant_1478)),
            '\u{1CDB5}' => Some((0x9F, block::block_octant_2478)),
            '\u{1CDB6}' => Some((0x29, block::block_octant_12478)),
            '\u{1CDB7}' => Some((0xBE, block::block_octant_3478)),
            '\u{1CDB8}' => Some((0x48, block::block_octant_13478)),
            '\u{1CDB9}' => Some((0x84, block::block_octant_23478)),
            '\u{1CDBA}' => Some((0x0A, block::block_octant_123478)),
            '\u{1CDBB}' => Some((0xE1, block::block_octant_578)),
            '\u{1CDBC}' => Some((0x6C, block::block_octant_1578)),
            '\u{1CDBD}' => Some((0xA7, block::block_octant_2578)),
            '\u{1CDBE}' => Some((0x31, block::block_octant_12578)),
            '\u{1CDBF}' => Some((0xC5, block::block_octant_3578)),
            '\u{1CDC0}' => Some((0x4E, block::block_octant_13578)),
            '\u{1CDC1}' => Some((0x8C, block::block_octant_23578)),
            '\u{1CDC2}' => Some((0x12, block::block_octant_123578)),
            '\u{1CDC3}' => Some((0xD5, block::block_octant_4578)),
            '\u{1CDC4}' => Some((0x5D, block::block_octant_14578)),
            '\u{1CDC5}' => Some((0x99, block::block_octant_24578)),
            '\u{1CDC6}' => Some((0x22, block::block_octant_124578)),
            '\u{1CDC7}' => Some((0xB7, block::block_octant_34578)),
            '\u{1CDC8}' => Some((0x41, block::block_octant_134578)),
            '\u{1CDC9}' => Some((0x7D, block::block_octant_234578)),
            '\u{1CDCA}' => Some((0x04, block::block_octant_1234578)),
            '\u{1CDCB}' => Some((0xE5, block::block_octant_678)),
            '\u{1CDCC}' => Some((0x70, block::block_octant_1678)),
            '\u{1CDCD}' => Some((0xAB, block::block_octant_2678)),
            '\u{1CDCE}' => Some((0x35, block::block_octant_12678)),
            '\u{1CDCF}' => Some((0xC9, block::block_octant_3678)),
            '\u{1CDD0}' => Some((0x52, block::block_octant_13678)),
            '\u{1CDD1}' => Some((0x90, block::block_octant_23678)),
            '\u{1CDD2}' => Some((0x16, block::block_octant_123678)),
            '\u{1CDD3}' => Some((0xD8, block::block_octant_4678)),
            '\u{1CDD4}' => Some((0x61, block::block_octant_14678)),
            '\u{1CDD5}' => Some((0x9D, block::block_octant_24678)),
            '\u{1CDD6}' => Some((0x26, block::block_octant_124678)),
            '\u{1CDD7}' => Some((0xBB, block::block_octant_34678)),
            '\u{1CDD8}' => Some((0x45, block::block_octant_134678)),
            '\u{1CDD9}' => Some((0x81, block::block_octant_234678)),
            '\u{1CDDA}' => Some((0x08, block::block_octant_1234678)),
            '\u{1CDDB}' => Some((0x69, block::block_octant_15678)),
            '\u{1CDDC}' => Some((0xA4, block::block_octant_25678)),
            '\u{1CDDD}' => Some((0x2E, block::block_octant_125678)),
            '\u{1CDDE}' => Some((0xC2, block::block_octant_35678)),
            '\u{1CDDF}' => Some((0x89, block::block_octant_235678)),
            '\u{1CDE0}' => Some((0x0F, block::block_octant_1235678)),
            '\u{1CDE1}' => Some((0xD2, block::block_octant_45678)),
            '\u{1CDE2}' => Some((0x5A, block::block_octant_145678)),
            '\u{1CDE3}' => Some((0x1F, block::block_octant_1245678)),
            '\u{1CDE4}' => Some((0x3E, block::block_octant_1345678)),
            '\u{1CDE5}' => Some((0x7A, block::block_octant_2345678)),
            '\u{1CDE6}'.. => None,
        };

        result.map(|(id_offset, render)| Self {
            id: base_id::BLOCK_OCTANTS + id_offset,
            key,
            render,
        })
    }

    fn try_braille_patterns(key: char) -> Option<Self> {
        let result: Option<(_, Render)> = match key {
            ..='\u{27FF}' => None,
            '\u{2800}' => Some((0x00, shape::braille::blank)),
            '\u{2801}' => Some((0x01, shape::braille::dots_1)),
            '\u{2802}' => Some((0x81, shape::braille::dots_2)),
            '\u{2803}' => Some((0x02, shape::braille::dots_12)),
            '\u{2804}' => Some((0xC1, shape::braille::dots_3)),
            '\u{2805}' => Some((0x42, shape::braille::dots_13)),
            '\u{2806}' => Some((0x82, shape::braille::dots_23)),
            '\u{2807}' => Some((0x03, shape::braille::dots_123)),
            '\u{2808}' => Some((0xE1, shape::braille::dots_4)),
            '\u{2809}' => Some((0x62, shape::braille::dots_14)),
            '\u{280A}' => Some((0xA2, shape::braille::dots_24)),
            '\u{280B}' => Some((0x23, shape::braille::dots_124)),
            '\u{280C}' => Some((0xC2, shape::braille::dots_34)),
            '\u{280D}' => Some((0x43, shape::braille::dots_134)),
            '\u{280E}' => Some((0x83, shape::braille::dots_234)),
            '\u{280F}' => Some((0x04, shape::braille::dots_1234)),
            '\u{2810}' => Some((0xF1, shape::braille::dots_5)),
            '\u{2811}' => Some((0x72, shape::braille::dots_15)),
            '\u{2812}' => Some((0xB2, shape::braille::dots_25)),
            '\u{2813}' => Some((0x33, shape::braille::dots_125)),
            '\u{2814}' => Some((0xD2, shape::braille::dots_35)),
            '\u{2815}' => Some((0x53, shape::braille::dots_135)),
            '\u{2816}' => Some((0x93, shape::braille::dots_235)),
            '\u{2817}' => Some((0x14, shape::braille::dots_1235)),
            '\u{2818}' => Some((0xE2, shape::braille::dots_45)),
            '\u{2819}' => Some((0x63, shape::braille::dots_145)),
            '\u{281A}' => Some((0xA3, shape::braille::dots_245)),
            '\u{281B}' => Some((0x24, shape::braille::dots_1245)),
            '\u{281C}' => Some((0xC3, shape::braille::dots_345)),
            '\u{281D}' => Some((0x44, shape::braille::dots_1345)),
            '\u{281E}' => Some((0x84, shape::braille::dots_2345)),
            '\u{281F}' => Some((0x05, shape::braille::dots_12345)),
            '\u{2820}' => Some((0xF9, shape::braille::dots_6)),
            '\u{2821}' => Some((0x7A, shape::braille::dots_16)),
            '\u{2822}' => Some((0xBA, shape::braille::dots_26)),
            '\u{2823}' => Some((0x3B, shape::braille::dots_126)),
            '\u{2824}' => Some((0xDA, shape::braille::dots_36)),
            '\u{2825}' => Some((0x5B, shape::braille::dots_136)),
            '\u{2826}' => Some((0x9B, shape::braille::dots_236)),
            '\u{2827}' => Some((0x1C, shape::braille::dots_1236)),
            '\u{2828}' => Some((0xEA, shape::braille::dots_46)),
            '\u{2829}' => Some((0x6B, shape::braille::dots_146)),
            '\u{282A}' => Some((0xAB, shape::braille::dots_246)),
            '\u{282B}' => Some((0x2C, shape::braille::dots_1246)),
            '\u{282C}' => Some((0xCB, shape::braille::dots_346)),
            '\u{282D}' => Some((0x4C, shape::braille::dots_1346)),
            '\u{282E}' => Some((0x8C, shape::braille::dots_2346)),
            '\u{282F}' => Some((0x0D, shape::braille::dots_12346)),
            '\u{2830}' => Some((0xF2, shape::braille::dots_56)),
            '\u{2831}' => Some((0x73, shape::braille::dots_156)),
            '\u{2832}' => Some((0xB3, shape::braille::dots_256)),
            '\u{2833}' => Some((0x34, shape::braille::dots_1256)),
            '\u{2834}' => Some((0xD3, shape::braille::dots_356)),
            '\u{2835}' => Some((0x54, shape::braille::dots_1356)),
            '\u{2836}' => Some((0x94, shape::braille::dots_2356)),
            '\u{2837}' => Some((0x15, shape::braille::dots_12356)),
            '\u{2838}' => Some((0xE3, shape::braille::dots_456)),
            '\u{2839}' => Some((0x64, shape::braille::dots_1456)),
            '\u{283A}' => Some((0xA4, shape::braille::dots_2456)),
            '\u{283B}' => Some((0x25, shape::braille::dots_12456)),
            '\u{283C}' => Some((0xC4, shape::braille::dots_3456)),
            '\u{283D}' => Some((0x45, shape::braille::dots_13456)),
            '\u{283E}' => Some((0x85, shape::braille::dots_23456)),
            '\u{283F}' => Some((0x06, shape::braille::dots_123456)),
            '\u{2840}' => Some((0xFD, shape::braille::dots_7)),
            '\u{2841}' => Some((0x7E, shape::braille::dots_17)),
            '\u{2842}' => Some((0xBE, shape::braille::dots_27)),
            '\u{2843}' => Some((0x3F, shape::braille::dots_127)),
            '\u{2844}' => Some((0xDE, shape::braille::dots_37)),
            '\u{2845}' => Some((0x5F, shape::braille::dots_137)),
            '\u{2846}' => Some((0x9F, shape::braille::dots_237)),
            '\u{2847}' => Some((0x20, shape::braille::dots_1237)),
            '\u{2848}' => Some((0xEE, shape::braille::dots_47)),
            '\u{2849}' => Some((0x6F, shape::braille::dots_147)),
            '\u{284A}' => Some((0xAF, shape::braille::dots_247)),
            '\u{284B}' => Some((0x30, shape::braille::dots_1247)),
            '\u{284C}' => Some((0xCF, shape::braille::dots_347)),
            '\u{284D}' => Some((0x50, shape::braille::dots_1347)),
            '\u{284E}' => Some((0x90, shape::braille::dots_2347)),
            '\u{284F}' => Some((0x11, shape::braille::dots_12347)),
            '\u{2850}' => Some((0xF6, shape::braille::dots_57)),
            '\u{2851}' => Some((0x77, shape::braille::dots_157)),
            '\u{2852}' => Some((0xB7, shape::braille::dots_257)),
            '\u{2853}' => Some((0x38, shape::braille::dots_1257)),
            '\u{2854}' => Some((0xD7, shape::braille::dots_357)),
            '\u{2855}' => Some((0x58, shape::braille::dots_1357)),
            '\u{2856}' => Some((0x98, shape::braille::dots_2357)),
            '\u{2857}' => Some((0x19, shape::braille::dots_12357)),
            '\u{2858}' => Some((0xE7, shape::braille::dots_457)),
            '\u{2859}' => Some((0x68, shape::braille::dots_1457)),
            '\u{285A}' => Some((0xA8, shape::braille::dots_2457)),
            '\u{285B}' => Some((0x29, shape::braille::dots_12457)),
            '\u{285C}' => Some((0xC8, shape::braille::dots_3457)),
            '\u{285D}' => Some((0x49, shape::braille::dots_13457)),
            '\u{285E}' => Some((0x89, shape::braille::dots_23457)),
            '\u{285F}' => Some((0x0A, shape::braille::dots_123457)),
            '\u{2860}' => Some((0xFA, shape::braille::dots_67)),
            '\u{2861}' => Some((0x7B, shape::braille::dots_167)),
            '\u{2862}' => Some((0xBB, shape::braille::dots_267)),
            '\u{2863}' => Some((0x3C, shape::braille::dots_1267)),
            '\u{2864}' => Some((0xDB, shape::braille::dots_367)),
            '\u{2865}' => Some((0x5C, shape::braille::dots_1367)),
            '\u{2866}' => Some((0x9C, shape::braille::dots_2367)),
            '\u{2867}' => Some((0x1D, shape::braille::dots_12367)),
            '\u{2868}' => Some((0xEB, shape::braille::dots_467)),
            '\u{2869}' => Some((0x6C, shape::braille::dots_1467)),
            '\u{286A}' => Some((0xAC, shape::braille::dots_2467)),
            '\u{286B}' => Some((0x2D, shape::braille::dots_12467)),
            '\u{286C}' => Some((0xCC, shape::braille::dots_3467)),
            '\u{286D}' => Some((0x4D, shape::braille::dots_13467)),
            '\u{286E}' => Some((0x8D, shape::braille::dots_23467)),
            '\u{286F}' => Some((0x0E, shape::braille::dots_123467)),
            '\u{2870}' => Some((0xF3, shape::braille::dots_567)),
            '\u{2871}' => Some((0x74, shape::braille::dots_1567)),
            '\u{2872}' => Some((0xB4, shape::braille::dots_2567)),
            '\u{2873}' => Some((0x35, shape::braille::dots_12567)),
            '\u{2874}' => Some((0xD4, shape::braille::dots_3567)),
            '\u{2875}' => Some((0x55, shape::braille::dots_13567)),
            '\u{2876}' => Some((0x95, shape::braille::dots_23567)),
            '\u{2877}' => Some((0x16, shape::braille::dots_123567)),
            '\u{2878}' => Some((0xE4, shape::braille::dots_4567)),
            '\u{2879}' => Some((0x65, shape::braille::dots_14567)),
            '\u{287A}' => Some((0xA5, shape::braille::dots_24567)),
            '\u{287B}' => Some((0x26, shape::braille::dots_124567)),
            '\u{287C}' => Some((0xC5, shape::braille::dots_34567)),
            '\u{287D}' => Some((0x46, shape::braille::dots_134567)),
            '\u{287E}' => Some((0x86, shape::braille::dots_234567)),
            '\u{287F}' => Some((0x07, shape::braille::dots_1234567)),
            '\u{2880}' => Some((0xFF, shape::braille::dots_8)),
            '\u{2881}' => Some((0x80, shape::braille::dots_18)),
            '\u{2882}' => Some((0xC0, shape::braille::dots_28)),
            '\u{2883}' => Some((0x41, shape::braille::dots_128)),
            '\u{2884}' => Some((0xE0, shape::braille::dots_38)),
            '\u{2885}' => Some((0x61, shape::braille::dots_138)),
            '\u{2886}' => Some((0xA1, shape::braille::dots_238)),
            '\u{2887}' => Some((0x22, shape::braille::dots_1238)),
            '\u{2888}' => Some((0xF0, shape::braille::dots_48)),
            '\u{2889}' => Some((0x71, shape::braille::dots_148)),
            '\u{288A}' => Some((0xB1, shape::braille::dots_248)),
            '\u{288B}' => Some((0x32, shape::braille::dots_1248)),
            '\u{288C}' => Some((0xD1, shape::braille::dots_348)),
            '\u{288D}' => Some((0x52, shape::braille::dots_1348)),
            '\u{288E}' => Some((0x92, shape::braille::dots_2348)),
            '\u{288F}' => Some((0x13, shape::braille::dots_12348)),
            '\u{2890}' => Some((0xF8, shape::braille::dots_58)),
            '\u{2891}' => Some((0x79, shape::braille::dots_158)),
            '\u{2892}' => Some((0xB9, shape::braille::dots_258)),
            '\u{2893}' => Some((0x3A, shape::braille::dots_1258)),
            '\u{2894}' => Some((0xD9, shape::braille::dots_358)),
            '\u{2895}' => Some((0x5A, shape::braille::dots_1358)),
            '\u{2896}' => Some((0x9A, shape::braille::dots_2358)),
            '\u{2897}' => Some((0x1B, shape::braille::dots_12358)),
            '\u{2898}' => Some((0xE9, shape::braille::dots_458)),
            '\u{2899}' => Some((0x6A, shape::braille::dots_1458)),
            '\u{289A}' => Some((0xAA, shape::braille::dots_2458)),
            '\u{289B}' => Some((0x2B, shape::braille::dots_12458)),
            '\u{289C}' => Some((0xCA, shape::braille::dots_3458)),
            '\u{289D}' => Some((0x4B, shape::braille::dots_13458)),
            '\u{289E}' => Some((0x8B, shape::braille::dots_23458)),
            '\u{289F}' => Some((0x0C, shape::braille::dots_123458)),
            '\u{28A0}' => Some((0xFC, shape::braille::dots_68)),
            '\u{28A1}' => Some((0x7D, shape::braille::dots_168)),
            '\u{28A2}' => Some((0xBD, shape::braille::dots_268)),
            '\u{28A3}' => Some((0x3E, shape::braille::dots_1268)),
            '\u{28A4}' => Some((0xDD, shape::braille::dots_368)),
            '\u{28A5}' => Some((0x5E, shape::braille::dots_1368)),
            '\u{28A6}' => Some((0x9E, shape::braille::dots_2368)),
            '\u{28A7}' => Some((0x1F, shape::braille::dots_12368)),
            '\u{28A8}' => Some((0xED, shape::braille::dots_468)),
            '\u{28A9}' => Some((0x6E, shape::braille::dots_1468)),
            '\u{28AA}' => Some((0xAE, shape::braille::dots_2468)),
            '\u{28AB}' => Some((0x2F, shape::braille::dots_12468)),
            '\u{28AC}' => Some((0xCE, shape::braille::dots_3468)),
            '\u{28AD}' => Some((0x4F, shape::braille::dots_13468)),
            '\u{28AE}' => Some((0x8F, shape::braille::dots_23468)),
            '\u{28AF}' => Some((0x10, shape::braille::dots_123468)),
            '\u{28B0}' => Some((0xF5, shape::braille::dots_568)),
            '\u{28B1}' => Some((0x76, shape::braille::dots_1568)),
            '\u{28B2}' => Some((0xB6, shape::braille::dots_2568)),
            '\u{28B3}' => Some((0x37, shape::braille::dots_12568)),
            '\u{28B4}' => Some((0xD6, shape::braille::dots_3568)),
            '\u{28B5}' => Some((0x57, shape::braille::dots_13568)),
            '\u{28B6}' => Some((0x97, shape::braille::dots_23568)),
            '\u{28B7}' => Some((0x18, shape::braille::dots_123568)),
            '\u{28B8}' => Some((0xE6, shape::braille::dots_4568)),
            '\u{28B9}' => Some((0x67, shape::braille::dots_14568)),
            '\u{28BA}' => Some((0xA7, shape::braille::dots_24568)),
            '\u{28BB}' => Some((0x28, shape::braille::dots_124568)),
            '\u{28BC}' => Some((0xC7, shape::braille::dots_34568)),
            '\u{28BD}' => Some((0x48, shape::braille::dots_134568)),
            '\u{28BE}' => Some((0x88, shape::braille::dots_234568)),
            '\u{28BF}' => Some((0x09, shape::braille::dots_1234568)),
            '\u{28C0}' => Some((0xFE, shape::braille::dots_78)),
            '\u{28C1}' => Some((0x7F, shape::braille::dots_178)),
            '\u{28C2}' => Some((0xBF, shape::braille::dots_278)),
            '\u{28C3}' => Some((0x40, shape::braille::dots_1278)),
            '\u{28C4}' => Some((0xDF, shape::braille::dots_378)),
            '\u{28C5}' => Some((0x60, shape::braille::dots_1378)),
            '\u{28C6}' => Some((0xA0, shape::braille::dots_2378)),
            '\u{28C7}' => Some((0x21, shape::braille::dots_12378)),
            '\u{28C8}' => Some((0xEF, shape::braille::dots_478)),
            '\u{28C9}' => Some((0x70, shape::braille::dots_1478)),
            '\u{28CA}' => Some((0xB0, shape::braille::dots_2478)),
            '\u{28CB}' => Some((0x31, shape::braille::dots_12478)),
            '\u{28CC}' => Some((0xD0, shape::braille::dots_3478)),
            '\u{28CD}' => Some((0x51, shape::braille::dots_13478)),
            '\u{28CE}' => Some((0x91, shape::braille::dots_23478)),
            '\u{28CF}' => Some((0x12, shape::braille::dots_123478)),
            '\u{28D0}' => Some((0xF7, shape::braille::dots_578)),
            '\u{28D1}' => Some((0x78, shape::braille::dots_1578)),
            '\u{28D2}' => Some((0xB8, shape::braille::dots_2578)),
            '\u{28D3}' => Some((0x39, shape::braille::dots_12578)),
            '\u{28D4}' => Some((0xD8, shape::braille::dots_3578)),
            '\u{28D5}' => Some((0x59, shape::braille::dots_13578)),
            '\u{28D6}' => Some((0x99, shape::braille::dots_23578)),
            '\u{28D7}' => Some((0x1A, shape::braille::dots_123578)),
            '\u{28D8}' => Some((0xE8, shape::braille::dots_4578)),
            '\u{28D9}' => Some((0x69, shape::braille::dots_14578)),
            '\u{28DA}' => Some((0xA9, shape::braille::dots_24578)),
            '\u{28DB}' => Some((0x2A, shape::braille::dots_124578)),
            '\u{28DC}' => Some((0xC9, shape::braille::dots_34578)),
            '\u{28DD}' => Some((0x4A, shape::braille::dots_134578)),
            '\u{28DE}' => Some((0x8A, shape::braille::dots_234578)),
            '\u{28DF}' => Some((0x0B, shape::braille::dots_1234578)),
            '\u{28E0}' => Some((0xFB, shape::braille::dots_678)),
            '\u{28E1}' => Some((0x7C, shape::braille::dots_1678)),
            '\u{28E2}' => Some((0xBC, shape::braille::dots_2678)),
            '\u{28E3}' => Some((0x3D, shape::braille::dots_12678)),
            '\u{28E4}' => Some((0xDC, shape::braille::dots_3678)),
            '\u{28E5}' => Some((0x5D, shape::braille::dots_13678)),
            '\u{28E6}' => Some((0x9D, shape::braille::dots_23678)),
            '\u{28E7}' => Some((0x1E, shape::braille::dots_123678)),
            '\u{28E8}' => Some((0xEC, shape::braille::dots_4678)),
            '\u{28E9}' => Some((0x6D, shape::braille::dots_14678)),
            '\u{28EA}' => Some((0xAD, shape::braille::dots_24678)),
            '\u{28EB}' => Some((0x2E, shape::braille::dots_124678)),
            '\u{28EC}' => Some((0xCD, shape::braille::dots_34678)),
            '\u{28ED}' => Some((0x4E, shape::braille::dots_134678)),
            '\u{28EE}' => Some((0x8E, shape::braille::dots_234678)),
            '\u{28EF}' => Some((0x0F, shape::braille::dots_1234678)),
            '\u{28F0}' => Some((0xF4, shape::braille::dots_5678)),
            '\u{28F1}' => Some((0x75, shape::braille::dots_15678)),
            '\u{28F2}' => Some((0xB5, shape::braille::dots_25678)),
            '\u{28F3}' => Some((0x36, shape::braille::dots_125678)),
            '\u{28F4}' => Some((0xD5, shape::braille::dots_35678)),
            '\u{28F5}' => Some((0x56, shape::braille::dots_135678)),
            '\u{28F6}' => Some((0x96, shape::braille::dots_235678)),
            '\u{28F7}' => Some((0x17, shape::braille::dots_1235678)),
            '\u{28F8}' => Some((0xE5, shape::braille::dots_45678)),
            '\u{28F9}' => Some((0x66, shape::braille::dots_145678)),
            '\u{28FA}' => Some((0xA6, shape::braille::dots_245678)),
            '\u{28FB}' => Some((0x27, shape::braille::dots_1245678)),
            '\u{28FC}' => Some((0xC6, shape::braille::dots_345678)),
            '\u{28FD}' => Some((0x47, shape::braille::dots_1345678)),
            '\u{28FE}' => Some((0x87, shape::braille::dots_2345678)),
            '\u{28FF}' => Some((0x08, shape::braille::dots_12345678)),
            '\u{2900}'.. => None,
        };

        result.map(|(id_offset, render)| Self {
            id: base_id::BRAILLE + id_offset,
            key,
            render,
        })
    }
}