-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathunicode-fonts.el
5190 lines (5045 loc) · 357 KB
/
unicode-fonts.el
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
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;;; unicode-fonts.el --- Configure Unicode fonts
;;
;; Copyright (c) 2012-2015 Roland Walker
;;
;; Author: Roland Walker <[email protected]>
;; Homepage: http://github.com/rolandwalker/unicode-fonts
;; URL: http://raw.githubusercontent.com/rolandwalker/unicode-fonts/master/unicode-fonts.el
;; Version: 0.4.10
;; Last-Updated: 1 Oct 2018
;; EmacsWiki: UnicodeFonts
;; Keywords: i18n, faces, frames, wp, interface
;; Package-Requires: ((font-utils "0.7.8") (ucs-utils "0.8.2") (list-utils "0.4.2") (persistent-soft "0.8.10") (pcache "0.3.1"))
;;
;; Simplified BSD License
;;
;;; Commentary:
;;
;; Quickstart:
;;
;; Configure an extended Latin font for your default face, such
;; as Monaco, Consolas, or DejaVu Sans Mono.
;;
;; Install these fonts
;;
;; https://dn-works.com/wp-content/uploads/2020/UFAS-Fonts/Symbola.zip
;; http://www.quivira-font.com/files/Quivira.ttf ; or Quivira.otf
;; http://sourceforge.net/projects/dejavu/files/dejavu/2.37/dejavu-fonts-ttf-2.37.tar.bz2
;; https://github.com/googlei18n/noto-fonts/raw/master/hinted/NotoSans-Regular.ttf
;; https://github.com/googlei18n/noto-fonts/raw/master/unhinted/NotoSansSymbols-Regular.ttf
;;
;; Remove Unifont from your system.
;;
;; (require 'unicode-fonts)
;;
;; (unicode-fonts-setup)
;;
;; Testing:
;;
;; C-h h ; M-x view-hello-file
;; M-x list-charset-chars RET unicode-bmp RET ; search for 210x
;; M-x list-charset-chars RET unicode-smp RET ; if your backend supports astral chars
;; M-x unicode-fonts-debug-insert-block RET Mathematical_Operators RET
;;
;; Explanation:
;;
;; Emacs maintains font mappings on a per-glyph basis, meaning
;; that multiple fonts are used at the same time (transparently) to
;; display any character for which you have a font. Furthermore,
;; Emacs does this out of the box.
;;
;; However, font mappings via fontsets are a bit difficult to
;; configure. In addition, the default setup does not always pick
;; the most legible fonts. As the manual warns, the choice of font
;; actually displayed for a non-ASCII character is "somewhat random".
;;
;; The Unicode standard provides a way to organize font mappings: it
;; divides character ranges into logical groups called "blocks". This
;; library configures Emacs in a Unicode-friendly way by providing
;; mappings from
;;
;; each Unicode block ---to---> a font with good coverage
;;
;; and makes the settings available via the customization interface.
;;
;; This library provides font mappings for 233 of the 255 blocks in
;; the Unicode 8.0 standard which are public and have displayable
;; characters. It assumes that 6 Latin blocks are covered by the
;; default font. 16/255 blocks are not mapped to any known font.
;;
;; To use unicode-fonts, place the unicode-fonts.el file somewhere
;; Emacs can find it, and add the following to your ~/.emacs file:
;;
;; (require 'unicode-fonts)
;; (unicode-fonts-setup)
;;
;; See important notes about startup speed below.
;;
;; To gain any benefit from the library, you must have fonts with good
;; Unicode support installed on your system. If you are running a
;; recent version of OS X or Microsoft Windows, you already own some
;; good multi-lingual fonts, though you would do very well to download
;; and install the four items below:
;;
;; From https://dejavu-fonts.github.io/
;;
;; DejaVu Sans, DejaVu Sans Mono
;;
;; From http://www.quivira-font.com/downloads.php
;;
;; Quivira
;;
;; From https://dn-works.com/wp-content/uploads/2020/UFAS-Fonts/Symbola.zip
;;
;; Symbola
;;
;; Many non-free fonts are referenced by the default settings.
;; However, free alternatives are also given wherever possible, and
;; patches are of course accepted to improve every case.
;;
;; On the assumption that an extended Latin font such as Monaco,
;; Consolas, or DejaVu Sans Mono is already being used for the default
;; face, no separate mappings are provided for the following Unicode
;; blocks:
;;
;; Basic Latin
;; Latin Extended Additional
;; Latin Extended-A
;; Latin Extended-B
;; Latin-1 Supplement
;; Spacing Modifier Letters
;;
;; though some of these remain configurable via `customize'.
;;
;; It is also recommended to remove GNU Unifont from your system.
;; Unifont is very useful for debugging, but not useful for reading.
;;
;; The default options favor correctness and completeness over speed,
;; and can add many seconds to initial startup time in GUI mode.
;; However, when possible a font cache is kept between sessions. If
;; you have persistent-soft.el installed, when you start Emacs the
;; second time, the startup cost should be negligible.
;;
;; The disk cache will be rebuilt during Emacs startup whenever a font
;; is added or removed, or any relevant configuration variables are
;; changed. To increase the speed of occasionally building the disk
;; cache, you may use the customization interface to remove fonts from
;; `unicode-fonts-block-font-mapping' which are not present on your
;; system.
;;
;; If you are using a language written in Chinese or Arabic script,
;; try customizing `unicode-fonts-skip-font-groups' to control which
;; script you see, and send a friendly bug report.
;;
;; Color Emoji are enabled by default when using the Native Mac port
;; on OS X. This can be disabled by customizing each relevant mapping,
;; or by turning off all multicolor glyphs here:
;;
;; M-x customize-variable RET unicode-fonts-skip-font-groups RET
;;
;; See Also
;;
;; M-x customize-group RET unicode-fonts RET
;; M-x customize-variable RET unicode-fonts-block-font-mapping RET
;;
;; Notes
;;
;; Free fonts recognized by this package may be downloaded from the
;; following locations. For any language, it is increasingly likely
;; that Noto Sans provides coverage:
;;
;; From http://www.google.com/get/noto/
;;
;; Noto Sans and friends ; 181 Unicode blocks and counting; sole
;; ; source for these blocks:
;; ;
;; ; Bamum / Bamum Supplement / Kaithi
;; ; Mandaic / Meetei Mayek Extensions
;; ; Sundanese Supplement
;; ;
;; ; Also a good source for recently-added
;; ; glyphs such as "Turkish Lira Sign".
;;
;; From http://scripts.sil.org/cms/scripts/page.php?item_id=CharisSIL_download
;; or http://scripts.sil.org/cms/scripts/page.php?item_id=DoulosSIL_download
;;
;; Charis SIL or Doulos SIL ; Extended European and diacritics
;;
;; From http://scripts.sil.org/cms/scripts/page.php?item_id=Gentium_download
;;
;; Gentium Plus ; Greek
;;
;; From http://users.teilar.gr/~g1951d/
;;
;; Aegean, Aegyptus, Akkadian ; Ancient languages
;; Analecta ; Ancient languages, Deseret
;; Anatolian ; Ancient languages
;; Musica ; Musical Symbols
;; Nilus ; Ancient languages
;;
;; From http://www.wazu.jp/gallery/views/View_MPH2BDamase.html
;;
;; MPH 2B Damase ; Arabic, Armenian, Buginese, Cherokee, Georgian,
;; ; Glagolitic, Hanunoo, Kharoshthi, Limbu, Osmanya,
;; ; Shavian, Syloti Nagri, Tai Le, Thaana
;;
;; From http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=NamdhinggoSIL
;;
;; Namdhinggo SIL ; Limbu
;;
;; From http://wenq.org/wqy2/index.cgi?FontGuide
;;
;; WenQuanYi Zen Hei ; CJK (Simplified Chinese)
;;
;; From http://babelstone.co.uk/Fonts/
;;
;; BabelStone Han ; CJK (Simplified Chinese)
;; BabelStone Phags-pa Book ; Phags-pa
;; BabelStone Modern ; Tags / Specials / Selectors
;;
;; From http://vietunicode.sourceforge.net/fonts/fonts_hannom.html
;;
;; HAN NOM A, HAN NOM B ; CJK (Nôm Chinese)
;;
;; From http://kldp.net/projects/unfonts/
;;
;; Un Batang ; CJK (Hangul)
;;
;; From http://sourceforge.jp/projects/hanazono-font/releases/
;;
;; Hana Min A, Hana Min B ; CJK (Japanese)
;;
;; From http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=SILYi_home
;;
;; Nuosu SIL ; CJK (Yi)
;;
;; From http://www.daicing.com/manchu/index.php?page=fonts-downloads
;;
;; Daicing Xiaokai ; Mongolian
;;
;; From http://www.library.gov.bt/IT/fonts.html
;;
;; Jomolhari ; Tibetan
;;
;; From http://www.thlib.org/tools/scripts/wiki/tibetan%20machine%20uni.html
;;
;; Tibetan Machine Uni ; Tibetan
;;
;; From http://scripts.sil.org/cms/scripts/page.php?item_id=Padauk
;;
;; Padauk ; Myanmar
;;
;; From https://code.google.com/p/myanmar3source/downloads/list
;;
;; Myanmar3 ; Myanmar
;;
;; From http://www.yunghkio.com/unicode/
;;
;; Yunghkio ; Myanmar
;;
;; From https://code.google.com/p/tharlon-font/downloads/list
;;
;; TharLon ; Myanmar
;;
;; From http://sourceforge.net/projects/prahita/files/Myanmar%20Unicode%20Fonts/MasterpieceUniSans/
;;
;; Masterpiece Uni Sans ; Myanmar
;;
;; From http://sarovar.org/projects/samyak/
;;
;; Samyak ; Gujarati, Malayalam, Oriya, Tamil
;;
;; From http://software.sil.org/annapurna/download/
;;
;; Annapurna SIL ; Devanagari
;;
;; From http://guca.sourceforge.net/typography/fonts/anmoluni/
;;
;; AnmolUni ; Gurmukhi
;;
;; From http://brahmi.sourceforge.net/downloads2.html
;;
;; Kedage ; Kannada
;;
;; From http://www.omicronlab.com/bangla-fonts.html
;;
;; Mukti Narrow ; Bengali
;;
;; From http://www.kamban.com.au/downloads.html
;;
;; Akshar Unicode ; Sinhala
;;
;; From http://tabish.freeshell.org/eeyek/download.html
;;
;; Eeyek Unicode ; Meetei Mayek
;;
;; From http://scripts.sil.org/CMS/scripts/page.php?&item_id=Mondulkiri
;;
;; Khmer Mondulkiri ; Khmer
;;
;; From http://www.laoscript.net/downloads/
;;
;; Saysettha MX ; Lao
;;
;; From http://www.geocities.jp/simsheart_alif/taithamunicode.html
;;
;; Lanna Alif ; Tai Tham
;;
;; From http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=DaiBannaSIL
;;
;; Dai Banna SIL ; New Tai Lue
;;
;; From http://scripts.sil.org/cms/scripts/page.php?item_id=TaiHeritage
;;
;; Tai Heritage Pro ; Tai Viet
;;
;; From http://sabilulungan.org/aksara/
;;
;; Sundanese Unicode ; Sundanese
;;
;; From http://www.amirifont.org/
;;
;; Amiri ; Arabic (Naskh)
;;
;; From http://scripts.sil.org/cms/scripts/page.php?item_id=Scheherazade
;;
;; Scheherazade ; Arabic (Naskh)
;;
;; From http://www.farsiweb.ir/wiki/Persian_fonts
;;
;; Koodak ; Arabic (Farsi)
;;
;; From http://openfontlibrary.org/font/ahuramazda/
;;
;; Ahuramzda ; Avestan
;;
;; From http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=AbyssinicaSIL
;;
;; Abyssinica SIL ; Ethiopic
;;
;; From http://www.bethmardutho.org/index.php/resources/fonts.html
;;
;; Estrangelo Nisibin ; Syriac
;;
;; From http://www.evertype.com/fonts/nko/
;;
;; Conakry ; N'ko
;;
;; From http://uni.hilledu.com/download-ribenguni
;;
;; Ribeng ; Chakma
;;
;; From http://www.virtualvinodh.com/downloads
;;
;; Adinatha Tamil Brahmi ; Brahmi
;;
;; From http://ftp.gnu.org/gnu/freefont/
;;
;; FreeMono, etc (FreeFont) ; Kayah Li (and others)
;;
;; From http://ulikozok.com/aksara-batak/batak-font/
;;
;; Batak-Unicode ; Batak
;;
;; From http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=Mingzat
;;
;; Mingzat ; Lepcha
;;
;; From http://phjamr.github.io/lisu.html#install
;; http://phjamr.github.io/miao.html#install
;; http://phjamr.github.io/mro.html#install
;;
;; Miao Unicode ; Miao
;; Lisu Unicode ; Lisu
;; Mro Unicode ; Mro
;;
;; From http://scholarsfonts.net/cardofnt.html
;;
;; Cardo ; Historical Languages
;;
;; From http://sourceforge.net/projects/junicode/files/junicode/
;;
;; Junicode ; Historical Languages
;;
;; From http://www.evertype.com/fonts/vai/
;;
;; Dukor ; Vai
;;
;; From http://sourceforge.net/projects/zhmono/
;;
;; ZH Mono ; Inscriptional Pahlavi / Parthian
;;
;; From http://culmus.sourceforge.net/ancient/index.html
;;
;; Aramaic Imperial Yeb ; Imperial Aramaic
;;
;; From http://www.languagegeek.com/font/fontdownload.html
;;
;; Aboriginal Sans ; Aboriginal Languages
;; Aboriginal Serif
;;
;; From http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=EzraSIL_Home
;;
;; Ezra SIL ; Hebrew
;;
;; From http://www.evertype.com/fonts/coptic/
;;
;; Antinoou ; Coptic / General Punctuation
;;
;; From http://apagreekkeys.org/NAUdownload.html
;;
;; New Athena Unicode ; Ancient Languages / Symbols
;;
;; From http://markmail.org/thread/g57mk4sbdycblxds
;;
;; KhojkiUnicodeOT ; Khojki
;;
;; From https://github.com/andjc/ahom-unicode/tree/master/font
;;
;; AhomUnicode ; Ahom
;;
;; From https://github.com/MihailJP/oldsindhi/releases
;;
;; OldSindhi ; Khudawadi
;;
;; From https://github.com/MihailJP/Muktamsiddham/releases
;;
;; MuktamsiddhamG ; Siddham (note trailing "G" on font name)
;;
;; From https://github.com/MihailJP/MarathiCursive/releases
;;
;; MarathiCursiveG ; Modi (note trailing "G" on font name)
;;
;; From https://github.com/OldHungarian/old-hungarian-font/releases
;;
;; OldHungarian ; Old Hungarian
;;
;; From http://tutohtml.perso.sfr.fr/unicode.html
;;
;; Albanian ; Elbasan / Takri / Sharada
;;
;; From https://github.com/enabling-languages/cham-unicode/tree/master/fonts/ttf
;;
;; Cham OI_Tangin ; Cham
;;
;; From https://ctan.org/tex-archive/fonts/Asana-Math?lang=en
;;
;; Asana Math ; Mathematical Symbols
;;
;; Compatibility and Requirements
;;
;; GNU Emacs version 23.3 and higher : yes
;; GNU Emacs version 22.3 and lower : no
;;
;; Requires font-utils.el, ucs-utils.el
;;
;; Bugs
;;
;; The default choice of font for each code block balances coverage
;; versus appearance. This is necessarily subjective.
;;
;; Unicode also defines the notion of a "script" as a higher-level
;; abstraction which is independent of "blocks". Modern fonts can
;; report their script coverage, and Emacs may also access that
;; information. However, this library ignores scripts in favor
;; of blocks and glyphs.
;;
;; Checking for font availability is slow. This library can
;; add anywhere between 0.1 - 10 secs to startup time. It is
;; slowest under X11. Some per-architecture limitations are
;; documented in font-utils.el
;;
;; Calling `set-fontset-font' can easily crash Emacs. There is a
;; workaround, but it may not be sufficient on all platforms.
;; Tested on Cocoa Emacs, Native Mac Emacs, X11/XQuartz,
;; MS Windows XP.
;;
;; Glyph-by-glyph fallthrough happens differently depending on the
;; font backend. On Cocoa Emacs, glyph-by-glyph fallthrough does not
;; occur, and manual per-glyph overrides are required to maximize
;; coverage. Fallthrough works on MS Windows, but not perfectly.
;; X11/FreeType behaves most predictably.
;;
;; The following ranges cannot be overridden within the
;; "fontset-default" fontset:
;;
;; Latin Extended Additional
;; Latin Extended-B
;; Spacing Modifier Letters
;;
;; `unicode-fonts-overrides-mapping' shows some order-dependence,
;; which must indicate a bug in this code.
;;
;; A number of the entries in `unicode-fonts-overrides-mapping'
;; are workarounds for the font Monaco, and therefore specific
;; to OS X.
;;
;; Widths of alternate fonts do not act as expected on MS Windows.
;; For example, DejaVu Sans Mono box-drawing characters may use
;; a different width than the default font.
;;
;; TODO
;;
;; provide additional interfaces
;; - dump set-fontset-font instructions
;; - immediately set font for character/current-character/range
;; - recommend font for current character
;; - alternatives to customize, which can be called before unicode-fonts-setup
;; - eg "prefer this font for this block"
;; - also character/range ie overrides
;;
;; scripts vs blocks
;; - further doc note
;; - provide alternative interface via scripts
;;
;; reorganize font list by language?
;; - break down into living/dead/invented
;;
;; support MUFI for PUA
;;
;; support ConScript for PUA
;;
;; Aramaic as a style of Hebrew
;;
;; (set-language-environment "UTF-8") ?
;;
;; Include all Windows 8 fonts
;;
;; Include all Windows 10 fonts
;;
;; Remove very old Microsoft entries (eg Monotype.com which was
;; renamed Andale)
;;
;; Recognize the default font and make smarter choices when it is
;; one of the provided mappings. (On Cocoa, the default font is
;; returned when font-info fails, which is not a good thing
;; overall.)
;;
;; For every font, list font version and unicode blocks which are
;; complete.
;;
;; Note all decorative fonts
;;
;; Adobe international fonts which are supplied with Reader
;;
;; Apple fonts which could not be mapped
;; Wawati TC
;; Weibei TC
;; Weibei SC
;; Wawati SC
;;
;;; License
;;
;; Simplified BSD License:
;;
;; Redistribution and use in source and binary forms, with or
;; without modification, are permitted provided that the following
;; conditions are met:
;;
;; 1. Redistributions of source code must retain the above
;; copyright notice, this list of conditions and the following
;; disclaimer.
;;
;; 2. Redistributions in binary form must reproduce the above
;; copyright notice, this list of conditions and the following
;; disclaimer in the documentation and/or other materials
;; provided with the distribution.
;;
;; This software is provided by Roland Walker "AS IS" and any express
;; or implied warranties, including, but not limited to, the implied
;; warranties of merchantability and fitness for a particular
;; purpose are disclaimed. In no event shall Roland Walker or
;; contributors be liable for any direct, indirect, incidental,
;; special, exemplary, or consequential damages (including, but not
;; limited to, procurement of substitute goods or services; loss of
;; use, data, or profits; or business interruption) however caused
;; and on any theory of liability, whether in contract, strict
;; liability, or tort (including negligence or otherwise) arising in
;; any way out of the use of this software, even if advised of the
;; possibility of such damage.
;;
;; The views and conclusions contained in the software and
;; documentation are those of the authors and should not be
;; interpreted as representing official policies, either expressed
;; or implied, of Roland Walker.
;;
;; No rights are claimed over data created by the Unicode
;; Consortium, which are included here under the terms of
;; the Unicode Terms of Use.
;;
;;; Code:
;;
;;; requirements
;; for cl-callf, cl-member, cl-incf, cl-remove-if, cl-remove-if-not, cl-assert, cl-loop, cl-copy-list
(require 'cl-lib)
(autoload 'persistent-soft-store "persistent-soft" "Under SYMBOL, store VALUE in the LOCATION persistent data store." )
(autoload 'persistent-soft-fetch "persistent-soft" "Return the value for SYMBOL in the LOCATION persistent data store." )
(autoload 'persistent-soft-exists-p "persistent-soft" "Return t if SYMBOL exists in the LOCATION persistent data store." )
(autoload 'persistent-soft-flush "persistent-soft" "Flush data for the LOCATION data store to disk." )
(autoload 'persistent-soft-location-readable "persistent-soft" "Return non-nil if LOCATION is a readable persistent-soft data store.")
(autoload 'persistent-soft-location-destroy "persistent-soft" "Destroy LOCATION (a persistent-soft data store)." )
(autoload 'font-utils-exists-p "font-utils" "Test whether FONT-NAME (a string or font object) exists.")
(autoload 'font-utils-read-name "font-utils" "Read a font name using `completing-read'.")
(autoload 'font-utils-lenient-name-equal "font-utils" "Leniently match two strings, FONT-NAME-A and FONT-NAME-B.")
(autoload 'font-utils-first-existing-font "font-utils" "Return the (normalized) first existing font name from FONT-NAMES.")
(autoload 'font-utils-name-from-xlfd "font-utils" "Return the font-family name from XLFD, a string.")
(autoload 'font-utils-is-qualified-variant "font-utils" "Test whether FONT-NAME-1 and FONT-NAME-2 are qualified variants of the same font.")
(autoload 'font-utils-list-names "font-utils" "Return a list of all font names on the current system.")
(autoload 'font-utils-client-hostname "font-utils" "Guess the client hostname, respecting $SSH_CONNECTION.")
(autoload 'ucs-utils-char "ucs-utils" "Return the character corresponding to NAME, a UCS name.")
(autoload 'ucs-utils-pretty-name "ucs-utils" "Return a prettified UCS name for CHAR.")
;;; constants
(defconst unicode-fonts-planes
'(("unicode-bmp" #x0000 #xFFFF) ; plane 0
("unicode-smp" #x10000 #x1FFFF) ; plane 1
("unicode-sip" #x20000 #x2FFFF) ; plane 2
("unicode-tip" #x30000 #x3FFFF) ; planes 3
("unicode-unassigned" #x40000 #xDFFFF) ; planes 4-13
("unicode-ssp" #xE0000 #xEFFFF) ; plane 14
("unicode-pua-a" #xF0000 #xFFFFF) ; plane 15
("unicode-pua-b" #x100000 #x10FFFF)) ; plane 16
"Alist of Unicode 13.0 planes.")
(defconst unicode-fonts-blocks
'(("Adlam" #x1E900 #x1E95F)
("Aegean Numbers" #x10100 #x1013F)
("Ahom" #x11700 #x1173F)
("Alchemical Symbols" #x1F700 #x1F77F)
("Alphabetic Presentation Forms" #xFB00 #xFB4F)
("Anatolian Hieroglyphs" #x14400 #x1467F)
("Ancient Greek Musical Notation" #x1D200 #x1D24F)
("Ancient Greek Numbers" #x10140 #x1018F)
("Ancient Symbols" #x10190 #x101CF)
("Arabic" #x0600 #x06FF)
("Arabic Extended-A" #x08A0 #x08FF)
("Arabic Mathematical Alphabetic Symbols" #x1EE00 #x1EEFF)
("Arabic Presentation Forms-A" #xFB50 #xFDFF)
("Arabic Presentation Forms-B" #xFE70 #xFEFF)
("Arabic Supplement" #x0750 #x077F)
("Armenian" #x0530 #x058F)
("Arrows" #x2190 #x21FF)
("Avestan" #x10B00 #x10B3F)
("Balinese" #x1B00 #x1B7F)
("Bamum" #xA6A0 #xA6FF)
("Bamum Supplement" #x16800 #x16A3F)
("Basic Latin" #x0000 #x007F)
("Bassa Vah" #x16AD0 #x16AFF)
("Batak" #x1BC0 #x1BFF)
("Bengali" #x0980 #x09FF)
("Bhaiksuki" #x11C00 #x11C6F)
("Block Elements" #x2580 #x259F)
("Bopomofo" #x3100 #x312F)
("Bopomofo Extended" #x31A0 #x31BF)
("Box Drawing" #x2500 #x257F)
("Brahmi" #x11000 #x1107F)
("Braille Patterns" #x2800 #x28FF)
("Buginese" #x1A00 #x1A1F)
("Buhid" #x1740 #x175F)
("Byzantine Musical Symbols" #x1D000 #x1D0FF)
("CJK Compatibility" #x3300 #x33FF)
("CJK Compatibility Forms" #xFE30 #xFE4F)
("CJK Compatibility Ideographs" #xF900 #xFAFF)
("CJK Compatibility Ideographs Supplement" #x2F800 #x2FA1F)
("CJK Radicals Supplement" #x2E80 #x2EFF)
("CJK Strokes" #x31C0 #x31EF)
("CJK Symbols and Punctuation" #x3000 #x303F)
("CJK Unified Ideographs" #x4E00 #x9FFF)
("CJK Unified Ideographs Extension A" #x3400 #x4DBF)
("CJK Unified Ideographs Extension B" #x20000 #x2A6DF)
("CJK Unified Ideographs Extension C" #x2A700 #x2B73F)
("CJK Unified Ideographs Extension D" #x2B740 #x2B81F)
("CJK Unified Ideographs Extension E" #x2B820 #x2CEAF)
("CJK Unified Ideographs Extension F" #x2CEB0 #x2EBEF)
("CJK Unified Ideographs Extension G" #x30000 #x3134F)
("Carian" #x102A0 #x102DF)
("Caucasian Albanian" #x10530 #x1056F)
("Chakma" #x11100 #x1114F)
("Cham" #xAA00 #xAA5F)
("Cherokee" #x13A0 #x13FF)
("Cherokee Supplement" #xAB70 #xABBF)
("Chess Symbols" #x1FA00 #x1FA6F)
("Chorasmian" #x10FB0 #x10FDF)
("Combining Diacritical Marks" #x0300 #x036F)
("Combining Diacritical Marks Extended" #x1AB0 #x1AFF)
("Combining Diacritical Marks Supplement" #x1DC0 #x1DFF)
("Combining Diacritical Marks for Symbols" #x20D0 #x20FF)
("Combining Half Marks" #xFE20 #xFE2F)
("Common Indic Number Forms" #xA830 #xA83F)
("Control Pictures" #x2400 #x243F)
("Coptic" #x2C80 #x2CFF)
("Coptic Epact Numbers" #x102E0 #x102FF)
("Counting Rod Numerals" #x1D360 #x1D37F)
("Cuneiform" #x12000 #x123FF)
("Cuneiform Numbers and Punctuation" #x12400 #x1247F)
("Currency Symbols" #x20A0 #x20CF)
("Cypriot Syllabary" #x10800 #x1083F)
("Cyrillic" #x0400 #x04FF)
("Cyrillic Extended-A" #x2DE0 #x2DFF)
("Cyrillic Extended-B" #xA640 #xA69F)
("Cyrillic Extended-C" #x1C80 #x1C8F)
("Cyrillic Supplement" #x0500 #x052F)
("Deseret" #x10400 #x1044F)
("Devanagari" #x0900 #x097F)
("Devanagari Extended" #xA8E0 #xA8FF)
("Dingbats" #x2700 #x27BF)
("Dives Akuru" #x11900 #x1195F)
("Dogra" #x11800 #x1184F)
("Domino Tiles" #x1F030 #x1F09F)
("Duployan" #x1BC00 #x1BC9F)
("Early Dynastic Cuneiform" #x12480 #x1254F)
("Egyptian Hieroglyph Format Controls" #x13430 #x1343F)
("Egyptian Hieroglyphs" #x13000 #x1342F)
("Elbasan" #x10500 #x1052F)
("Elymaic" #x10FE0 #x10FFF)
("Emoticons" #x1F600 #x1F64F)
("Enclosed Alphanumeric Supplement" #x1F100 #x1F1FF)
("Enclosed Alphanumerics" #x2460 #x24FF)
("Enclosed CJK Letters and Months" #x3200 #x32FF)
("Enclosed Ideographic Supplement" #x1F200 #x1F2FF)
("Ethiopic" #x1200 #x137F)
("Ethiopic Extended" #x2D80 #x2DDF)
("Ethiopic Extended-A" #xAB00 #xAB2F)
("Ethiopic Supplement" #x1380 #x139F)
("General Punctuation" #x2000 #x206F)
("Geometric Shapes" #x25A0 #x25FF)
("Geometric Shapes Extended" #x1F780 #x1F7FF)
("Georgian" #x10A0 #x10FF)
("Georgian Extended" #x1C90 #x1CBF)
("Georgian Supplement" #x2D00 #x2D2F)
("Glagolitic" #x2C00 #x2C5F)
("Glagolitic Supplement" #x1E000 #x1E02F)
("Gothic" #x10330 #x1034F)
("Grantha" #x11300 #x1137F)
("Greek Extended" #x1F00 #x1FFF)
("Greek and Coptic" #x0370 #x03FF)
("Gujarati" #x0A80 #x0AFF)
("Gunjala Gondi" #x11D60 #x11DAF)
("Gurmukhi" #x0A00 #x0A7F)
("Halfwidth and Fullwidth Forms" #xFF00 #xFFEF)
("Hangul Compatibility Jamo" #x3130 #x318F)
("Hangul Jamo" #x1100 #x11FF)
("Hangul Jamo Extended-A" #xA960 #xA97F)
("Hangul Jamo Extended-B" #xD7B0 #xD7FF)
("Hangul Syllables" #xAC00 #xD7AF)
("Hanifi Rohingya" #x10D00 #x10D3F)
("Hanunoo" #x1720 #x173F)
("Hatran" #x108E0 #x108FF)
("Hebrew" #x0590 #x05FF)
;; ("High Private Use Surrogates" #xDB80 #xDBFF) ; no displayable characters
;; ("High Surrogates" #xD800 #xDB7F) ; no displayable characters
("Hiragana" #x3040 #x309F)
("IPA Extensions" #x0250 #x02AF)
("Ideographic Description Characters" #x2FF0 #x2FFF)
("Ideographic Symbols and Punctuation" #x16FE0 #x16FFF)
("Imperial Aramaic" #x10840 #x1085F)
("Indic Siyaq Numbers" #x1EC70 #x1ECBF)
("Inscriptional Pahlavi" #x10B60 #x10B7F)
("Inscriptional Parthian" #x10B40 #x10B5F)
("Javanese" #xA980 #xA9DF)
("Kaithi" #x11080 #x110CF)
("Kana Extended-A" #x1B100 #x1B12F)
("Kana Supplement" #x1B000 #x1B0FF)
("Kanbun" #x3190 #x319F)
("Kangxi Radicals" #x2F00 #x2FDF)
("Kannada" #x0C80 #x0CFF)
("Katakana" #x30A0 #x30FF)
("Katakana Phonetic Extensions" #x31F0 #x31FF)
("Kayah Li" #xA900 #xA92F)
("Kharoshthi" #x10A00 #x10A5F)
("Khitan Small Script" #x18B00 #x18CFF)
("Khmer" #x1780 #x17FF)
("Khmer Symbols" #x19E0 #x19FF)
("Khojki" #x11200 #x1124F)
("Khudawadi" #x112B0 #x112FF)
("Lao" #x0E80 #x0EFF)
("Latin Extended Additional" #x1E00 #x1EFF)
("Latin Extended-A" #x0100 #x017F)
("Latin Extended-B" #x0180 #x024F)
("Latin Extended-C" #x2C60 #x2C7F)
("Latin Extended-D" #xA720 #xA7FF)
("Latin Extended-E" #xAB30 #xAB6F)
("Latin-1 Supplement" #x0080 #x00FF)
("Lepcha" #x1C00 #x1C4F)
("Letterlike Symbols" #x2100 #x214F)
("Limbu" #x1900 #x194F)
("Linear A" #x10600 #x1077F)
("Linear B Ideograms" #x10080 #x100FF)
("Linear B Syllabary" #x10000 #x1007F)
("Lisu" #xA4D0 #xA4FF)
("Lisu Supplement" #x11FB0 #x11FBF)
;; ("Low Surrogates" #xDC00 #xDFFF) ; no displayable characters
("Lycian" #x10280 #x1029F)
("Lydian" #x10920 #x1093F)
("Mahajani" #x11150 #x1117F)
("Mahjong Tiles" #x1F000 #x1F02F)
("Makasar" #x11EE0 #x11EFF)
("Malayalam" #x0D00 #x0D7F)
("Mandaic" #x0840 #x085F)
("Manichaean" #x10AC0 #x10AFF)
("Marchen" #x11C70 #x11CBF)
("Masaram Gondi" #x11D00 #x11D5F)
("Mathematical Alphanumeric Symbols" #x1D400 #x1D7FF)
("Mathematical Operators" #x2200 #x22FF)
("Mayan Numerals" #x1D2E0 #x1D2FF)
("Medefaidrin" #x16E40 #x16E9F)
("Meetei Mayek" #xABC0 #xABFF)
("Meetei Mayek Extensions" #xAAE0 #xAAFF)
("Mende Kikakui" #x1E800 #x1E8DF)
("Meroitic Cursive" #x109A0 #x109FF)
("Meroitic Hieroglyphs" #x10980 #x1099F)
("Miao" #x16F00 #x16F9F)
("Miscellaneous Mathematical Symbols-A" #x27C0 #x27EF)
("Miscellaneous Mathematical Symbols-B" #x2980 #x29FF)
("Miscellaneous Symbols" #x2600 #x26FF)
("Miscellaneous Symbols and Arrows" #x2B00 #x2BFF)
("Miscellaneous Symbols and Pictographs" #x1F300 #x1F5FF)
("Miscellaneous Technical" #x2300 #x23FF)
("Modi" #x11600 #x1165F)
("Modifier Tone Letters" #xA700 #xA71F)
("Mongolian" #x1800 #x18AF)
("Mongolian Supplement" #x11660 #x1167F)
("Mro" #x16A40 #x16A6F)
("Multani" #x11280 #x112AF)
("Musical Symbols" #x1D100 #x1D1FF)
("Myanmar" #x1000 #x109F)
("Myanmar Extended-A" #xAA60 #xAA7F)
("Myanmar Extended-B" #xA9E0 #xA9FF)
("NKo" #x07C0 #x07FF)
("Nabataean" #x10880 #x108AF)
("Nandinagari" #x119A0 #x119FF)
("New Tai Lue" #x1980 #x19DF)
("Newa" #x11400 #x1147F)
("Number Forms" #x2150 #x218F)
("Nushu" #x1B170 #x1B2FF)
("Nyiakeng Puachue Hmong" #x1E100 #x1E14F)
("Ogham" #x1680 #x169F)
("Ol Chiki" #x1C50 #x1C7F)
("Old Hungarian" #x10C80 #x10CFF)
("Old Italic" #x10300 #x1032F)
("Old North Arabian" #x10A80 #x10A9F)
("Old Permic" #x10350 #x1037F)
("Old Persian" #x103A0 #x103DF)
("Old Sogdian" #x10F00 #x10F2F)
("Old South Arabian" #x10A60 #x10A7F)
("Old Turkic" #x10C00 #x10C4F)
("Optical Character Recognition" #x2440 #x245F)
("Oriya" #x0B00 #x0B7F)
("Ornamental Dingbats" #x1F650 #x1F67F)
("Osage" #x104B0 #x104FF)
("Osmanya" #x10480 #x104AF)
("Ottoman Siyaq Numbers" #x1ED00 #x1ED4F)
("Pahawh Hmong" #x16B00 #x16B8F)
("Palmyrene" #x10860 #x1087F)
("Pau Cin Hau" #x11AC0 #x11AFF)
("Phags-pa" #xA840 #xA87F)
("Phaistos Disc" #x101D0 #x101FF)
("Phoenician" #x10900 #x1091F)
("Phonetic Extensions" #x1D00 #x1D7F)
("Phonetic Extensions Supplement" #x1D80 #x1DBF)
("Playing Cards" #x1F0A0 #x1F0FF)
("Private Use Area" #xE000 #xF8FF)
("Psalter Pahlavi" #x10B80 #x10BAF)
("Rejang" #xA930 #xA95F)
("Rumi Numeral Symbols" #x10E60 #x10E7F)
("Runic" #x16A0 #x16FF)
("Samaritan" #x0800 #x083F)
("Saurashtra" #xA880 #xA8DF)
("Sharada" #x11180 #x111DF)
("Shavian" #x10450 #x1047F)
;; ("Shorthand Format Controls" #x1BCA0 #x1BCAF) ; no displayable characters
("Siddham" #x11580 #x115FF)
("Sinhala" #x0D80 #x0DFF)
("Sinhala Archaic Numbers" #x111E0 #x111FF)
("Small Form Variants" #xFE50 #xFE6F)
("Small Kana Extension" #x1B130 #x1B16F)
("Sogdian" #x10F30 #x10F6F)
("Sora Sompeng" #x110D0 #x110FF)
("Soyombo" #x11A50 #x11AAF)
("Spacing Modifier Letters" #x02B0 #x02FF)
("Specials" #xFFF0 #xFFFF)
("Sundanese" #x1B80 #x1BBF)
("Sundanese Supplement" #x1CC0 #x1CCF)
("Superscripts and Subscripts" #x2070 #x209F)
("Supplemental Arrows-A" #x27F0 #x27FF)
("Supplemental Arrows-B" #x2900 #x297F)
("Supplemental Arrows-C" #x1F800 #x1F8FF)
("Supplemental Mathematical Operators" #x2A00 #x2AFF)
("Supplemental Punctuation" #x2E00 #x2E7F)
("Supplemental Symbols and Pictographs" #x1F900 #x1F9FF)
("Supplementary Private Use Area-A" #xF0000 #xFFFFF)
("Supplementary Private Use Area-B" #x100000 #x10FFFF)
("Sutton SignWriting" #x1D800 #x1DAAF)
("Syloti Nagri" #xA800 #xA82F)
("Symbols and Pictographs Extended-A" #x1FA70 #x1FAFF)
("Symbols for Legacy Computing" #x1FB00 #x1FBFF)
("Syriac" #x0700 #x074F)
("Syriac Supplement" #x0860 #x086F)
("Tagalog" #x1700 #x171F)
("Tagbanwa" #x1760 #x177F)
("Tags" #xE0000 #xE007F)
("Tai Le" #x1950 #x197F)
("Tai Tham" #x1A20 #x1AAF)
("Tai Viet" #xAA80 #xAADF)
("Tai Xuan Jing Symbols" #x1D300 #x1D35F)
("Takri" #x11680 #x116CF)
("Tamil" #x0B80 #x0BFF)
("Tamil Supplement" #x11FC0 #x11FFF)
("Tangut" #x17000 #x187FF)
("Tangut Components" #x18800 #x18AFF)
("Tangut Supplement" #x18D00 #x18D8F)
("Telugu" #x0C00 #x0C7F)
("Thaana" #x0780 #x07BF)
("Thai" #x0E00 #x0E7F)
("Tibetan" #x0F00 #x0FFF)
("Tifinagh" #x2D30 #x2D7F)
("Tirhuta" #x11480 #x114DF)
("Transport and Map Symbols" #x1F680 #x1F6FF)
("Ugaritic" #x10380 #x1039F)
("Unified Canadian Aboriginal Syllabics" #x1400 #x167F)
("Unified Canadian Aboriginal Syllabics Extended" #x18B0 #x18FF)
("Vai" #xA500 #xA63F)
("Variation Selectors" #xFE00 #xFE0F)
("Variation Selectors Supplement" #xE0100 #xE01EF)
("Vedic Extensions" #x1CD0 #x1CFF)
("Vertical Forms" #xFE10 #xFE1F)
("Wancho" #x1E2C0 #x1E2FF)
("Warang Citi" #x118A0 #x118FF)
("Yezidi" #x10E80 #x10EBF)
("Yi Radicals" #xA490 #xA4CF)
("Yi Syllables" #xA000 #xA48F)
("Yijing Hexagram Symbols" #x4DC0 #x4DFF)
("Zanabazar Square" #x11A00 #x11A4F))
"Alist of Unicode 13.0 blocks.")
(defvar unicode-fonts-known-font-characteristics
'(("Abadi MT Condensed" :licenses (microsoft))
("Aboriginal Sans" :licenses (free))
("Aboriginal Serif" :licenses (free))
("Abyssinica SIL" :licenses (free))
("Adinatha Tamil Brahmi" :licenses (free))
("Adobe Arabic" :licenses (adobe) :arabic naskh)
("Adobe Hebrew" :licenses (adobe))
("Adobe Minion Web" :licenses (microsoft))
("African Sans" :licenses (free))
("African Serif" :licenses (free))
("Aldhabi" :licenses (microsoft) :arabic naskh)
("Albanian" :licenses (free))
("Aegean" :licenses (free))
("Aegyptus" :licenses (free))
("Agency FB" :licenses (microsoft))
("AhomUnicode" :licenses (free))
("Aharoni" :licenses (microsoft))
("Ahuramzda" :licenses (free))
("Akaash" :licenses (free))
("Akkadian" :licenses (free))
("Aksara Bali" :licenses (free))
("Akshar Unicode" :licenses (free))
("Al Bayan" :licenses (apple) :arabic naskh)
("Aleem Urdu Unicode" :licenses (free) :arabic urdu)
("Algerian" :licenses (microsoft))
("Almanac MT" :licenses (microsoft))
("ALPHABETUM Unicode" :licenses (commercial))
("American Typewriter" :licenses (apple))
("American Uncial" :licenses (microsoft))
("Amiri" :licenses (free) :arabic naskh)
("Analecta" :licenses (free))
("Anatolian" :licenses (free))
("Andagii" :licenses (free))
("Andale Mono" :spacing mono :licenses (apple microsoft))
("Andalus" :licenses (microsoft))
("Andy" :licenses (microsoft))
("Angsana New" :licenses (microsoft))
("AngsanaUPC" :licenses (microsoft))
("AnmolUni" :licenses (free))
("Annapurna SIL" :licenses (free))
("Antinoou" :licenses (free))
("Aparajita" :licenses (microsoft))
("Apple Braille" :licenses (apple))
("Apple Casual" :licenses (apple))
("Apple Chancery" :licenses (apple))
("Apple Color Emoji" :licenses (apple) :color multi)
("AppleGothic" :licenses (apple))
("Apple LiGothic" :licenses (apple) :chinese traditional)
("Apple LiSung" :licenses (apple) :chinese traditional)
("AppleMyungjo" :licenses (apple) :glyph-quality low)
("Apple SD Gothic Neo" :licenses (apple))
("Apple Symbols" :licenses (apple))
("Arabic Transparent" :licenses (microsoft) :arabic naskh)
("Arabic Typesetting" :licenses (microsoft) :arabic naskh)
("Aramaic Imperial Yeb" :licenses (free))
("Arial Black" :licenses (apple microsoft))
("Arial Hebrew" :licenses (apple))
("Arial Narrow Special" :licenses (microsoft))
("Arial Narrow" :licenses (apple microsoft))
("Arial Rounded MT Bold" :licenses (apple microsoft))
("Arial Special" :licenses (microsoft))
("Arial Unicode MS" :licenses (apple microsoft) :arabic naskh)
("Arial" :licenses (apple microsoft))
("Asana Math" :licenses (free))
("Augsburger Initials" :licenses (microsoft))
("Avenir Next Condensed" :licenses (apple))
("Avenir Next" :licenses (apple))
("Avenir" :licenses (apple))
("Ayuthaya" :licenses (apple))
("BabelStone Han" :chinese simplified :licenses (free))
("BabelStone Modern" :licenses (free))
("BabelStone Phags-pa Book" :licenses (free))
("Baghdad" :licenses (apple) :arabic naskh)
("Bangla MN" :licenses (apple))
("Bangla Sangam MN" :licenses (apple))
("Baoli SC" :licenses (apple) :chinese simplified)
("Baskerville Old Face" :licenses (microsoft))
("Baskerville" :licenses (apple))
("Batak-Unicode" :licenses (free))