Emacs Init: Font for Emoji
Set Font for emoji
put this in your Emacs Init File:
(progn ;; set font for emoji ;; if before emacs 28, this should come after setting symbols, because emacs 28 now has 'emoji . before, emoji is part of 'symbol (set-fontset-font t (if (version< emacs-version "28.1") '(#x1f300 . #x1fad0) 'emoji ) (cond ((member "Apple Color Emoji" (font-family-list)) "Apple Color Emoji") ((member "Noto Color Emoji" (font-family-list)) "Noto Color Emoji") ((member "Noto Emoji" (font-family-list)) "Noto Emoji") ((member "Segoe UI Emoji" (font-family-list)) "Segoe UI Emoji") ((member "Symbola" (font-family-list)) "Symbola"))))
Set Font for Other Languages
You should set a font for emoji and other unicode symbols or human languages. Especially on Mac and Microsoft Windows.
If you do not, whenever you open a file with lots characters that is not in current font, emacs will search a font for those characters, and may take 5 seconds.
- script-representative-chars
- Variable. Alist of scripts vs the representative characters. Each element is a cons (SCRIPT . CHARS). SCRIPT is a symbol representing a script or a subgroup of a script. CHARS is a list or a vector of characters. 〔see Emacs: Show Variable Value〕
Find a script supported in emacs by the variable script-representative-chars, then find out what's the font name in your operating system that supports that script. Then you can setup a font for the script in emacs, like this:
;; set font for cuneiform (set-fontset-font t 'cuneiform (cond ((eq system-type 'windows-nt) (cond ((member "Segoe UI Historic" (font-family-list)) "Segoe UI Historic"))) ((eq system-type 'darwin) (cond ((member "Noto Sans Cuneiform Regular" (font-family-list)) "Noto Sans Cuneiform Regular"))) ((eq system-type 'gnu/linux) (cond ((member "Noto Sans Cuneiform Regular" (font-family-list)) "Noto Sans Cuneiform Regular"))))) (set-fontset-font t 'phoenician (cond ((eq system-type 'windows-nt) (cond ((member "Segoe UI Historic" (font-family-list)) "Segoe UI Historic"))) ((eq system-type 'darwin) (cond ((member "Noto Sans Phoenician Regular" (font-family-list)) "Noto Sans Phoenician Regular"))) ((eq system-type 'gnu/linux) (cond ((member "Noto Sans Phoenician Regular" (font-family-list)) "Noto Sans Phoenician Regular"))))) (set-fontset-font t 'deseret (cond ((eq system-type 'windows-nt) (cond ((member "Segoe UI Symbol" (font-family-list)) "Segoe UI Symbol"))) ((eq system-type 'darwin) (cond ((member "Apple Symbols" (font-family-list)) "Apple Symbols"))) ((eq system-type 'gnu/linux) (cond ((member "Noto Sans Deseret" (font-family-list)) "Noto Sans Deseret"))))) (set-fontset-font t 'shavian (cond ((eq system-type 'windows-nt) (cond ((member "Segoe UI Historic" (font-family-list)) "Segoe UI Historic"))) ((eq system-type 'darwin) (cond ((member "Apple Symbols" (font-family-list)) "Apple Symbols"))) ((eq system-type 'gnu/linux) (cond ((member "Noto Sans Shavian Regular" (font-family-list)) "Noto Sans Shavian Regular"))))) (set-fontset-font t 'egyptian (cond ((eq system-type 'windows-nt) (cond ((member "Segoe UI Historic" (font-family-list)) "Segoe UI Historic"))) ((eq system-type 'darwin) (cond ((member "Noto Sans Egyptian Hieroglyphs" (font-family-list)) "Noto Sans Egyptian Hieroglyphs"))) ((eq system-type 'gnu/linux) (cond ((member "Aegyptus" (font-family-list)) "Aegyptus")))))
Emacs and Unicode
- Emacs: Insert Unicode Character
- Emacs: Insert Emoji
- Emacs: Input Method
- Emacs: Get Character Info, Cursor Position
- Emacs Init: Update Unicode Data
File Encoding
Unicode Font Setup
Emacs, font setup
- Emacs: Change Font Size
- Emacs: Change Default Font Size by Command, for Current Session 🚀
- Emacs: Get Character Info, Cursor Position
- Emacs: Toggle Monospace / Proportional Font
- Best Unicode Fonts for Programer
- Emacs: Cycle Fonts by Command 🚀
- Emacs Init: Setup Font
- Emacs Init: Font for Unicode Symbols
- Emacs Init: Font for Emoji
- Emacs Init: Font for Chinese
- Emacs Init: Minibuffer Font Size
- Emacs Init: Variable Pitch Mode (Proportional Font)
- Elisp: Modify Default Face (Font)
- Emacs Init: Display Lambda as λ