Configure Unicode fonts for Emacs.
- Minimum Useful Fonts
- Startup Speed
- Unmapped Blocks
- Free International and Symbol Fonts
- Non-free Fonts
- Chinese and Arabic Scripts
- Unicode "Scripts"
- Compatibility and Requirements
Remove Unifont from your system.
Install these fonts
- http://www.quivira-font.com/files/Quivira.ttf ; or Quivira.otf
Use an extended Latin font for your default face, such as Monaco, Consolas, or DejaVu Sans Mono.
(require 'unicode-fonts) (unicode-fonts-setup)
|C-h h||same as M-x view-hello-file|
|M-x list-charset-chars RET unicode-bmp RET||search for eg 210x|
|M-x list-charset-chars RET unicode-smp RET||if your display backend supports astral chars|
|M-x unicode-fonts-debug-insert-block RET Mathematical_Operators RET|
M-x customize-group RET unicode-fonts RET
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 215 of the 245 blocks in the Unicode 7.0 standard which are public and have displayable characters. It assumes that 6 Latin blocks are covered by the default font. 24/245 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
(require 'unicode-fonts) (unicode-fonts-setup)
See important notes about startup speed below.
Minimum Useful Fonts
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 six items below:
DejaVu Sans, DejaVu Sans Mono
Noto Sans, Noto Sans Symbols
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
which are not present on your system.
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
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
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.
Widths of alternate fonts do not behave as expected on MS Windows. For example, DejaVu Sans Mono box-drawing characters may use a different width than the default font.
Free International and Symbol Fonts
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:
Noto Sans and friends ; 178 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".
Charis SIL or Doulos SIL ; Extended European and diacritics
Gentium Plus ; Greek
Aegean, Aegyptus, Akkadian ; Ancient languages Analecta ; Ancient languages, Deseret Musica ; Musical Symbols Nilus ; Ancient languages
MPH 2B Damase ; Arabic, Armenian, Buginese, Cherokee, Georgian, ; Glagolitic, Hanunoo, Kharoshthi, Limbu, Osmanya, ; Shavian, Syloti Nagri, Tai Le, Thaana
Namdhinggo SIL ; Limbu
WenQuanYi Zen Hei ; CJK (Simplified Chinese)
BabelStone Han ; CJK (Simplified Chinese) BabelStone Phags-pa Book ; Phags-pa BabelStone Modern ; Tags / Specials / Selectors
HAN NOM A, HAN NOM B ; CJK (Nôm Chinese)
Un Batang ; CJK (Hangul)
Hana Min A, Hana Min B ; CJK (Japanese)
Nuosu SIL ; CJK (Yi)
Daicing Xiaokai ; Mongolian
Jomolhari ; Tibetan
Tibetan Machine Uni ; Tibetan
Padauk ; Myanmar
Myanmar3 ; Myanmar
Yunghkio ; Myanmar
TharLon ; Myanmar
Masterpiece Uni Sans ; Myanmar
Samyak ; Devanagari, Gujarati, Malayalam, Oriya, Tamil
AnmolUni ; Gurmukhi
Kedage ; Kannada
Mukti Narrow ; Bengali
Akshar Unicode ; Sinhala
Eeyek Unicode ; Meetei Mayek
Khmer Mondulkiri ; Khmer
Saysettha MX ; Lao
Lanna Alif ; Tai Tham
Dai Banna SIL ; New Tai Lue
Tai Heritage Pro ; Tai Viet
Sundanese Unicode ; Sundanese
Amiri ; Arabic (Naskh)
Scheherazade ; Arabic (Naskh)
Koodak ; Arabic (Farsi)
Ahuramzda ; Avestan
Abyssinica SIL ; Ethiopic
Estrangelo Nisibin ; Syriac
Conakry ; N'ko
Ribeng ; Chakma
Adinatha Tamil Brahmi ; Brahmi
FreeMono, etc (FreeFont) ; Kayah Li (and others)
Batak-Unicode ; Batak
Mingzat ; Lepcha
Lisu Unicode ; Lisu Miao Unicode ; Miao Mro Unicode ; Mro
Cardo ; Historical Languages
Junicode ; Historical Languages
Dukor ; Vai
ZH Mono ; Inscriptional Pahlavi / Parthian
Aramaic Imperial Yeb ; Imperial Aramaic
Aboriginal Sans ; Aboriginal Languages Aboriginal Serif
Ezra SIL ; Hebrew
Antinoou ; Coptic / General Punctuation
New Athena Unicode ; Ancient Languages / Symbols
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.
Chinese and Arabic Scripts
If you are using a language written in Chinese or Arabic script,
unicode-fonts-skip-font-groups to control which
script you see, and send a friendly bug report.
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.
Compatibility and Requirements
GNU Emacs version 24.4-devel : yes, at the time of writing GNU Emacs version 24.3 : yes GNU Emacs version 23.3 : yes GNU Emacs version 22.3 and lower : no
Uses if present: persistent-soft.el (Recommended)