|
6 | 6 | - [[#description][Description]]
|
7 | 7 | - [[#features][Features:]]
|
8 | 8 | - [[#install][Install]]
|
9 |
| -- [[#ligature-fonts][Ligature Fonts]] |
| 9 | +- [[#configuration][Configuration]] |
10 | 10 |
|
11 | 11 | * Description
|
12 | 12 | This layer adds support for [[https://github.com/rolandwalker/unicode-fonts][unicode-fonts]] package. It is recommended to
|
13 | 13 | install the fonts listed in the [[https://github.com/rolandwalker/unicode-fonts#quickstart][Quickstart]] section of the unicode-fonts README.
|
14 | 14 |
|
15 | 15 | ** Features:
|
16 |
| -- Display unicode glyphs using the best available font. |
| 16 | +- Display Unicode glyphs using the best available font. |
17 | 17 | - Easily override glyphs or sections of glyphs.
|
18 |
| -- Display color emoji on both the macOS port version of Emacs and emacs-plus (with |
19 |
| - =unicode-fonts-force-multi-color-on-mac= set to non nil). |
| 18 | +- Display color emoji on both the macOS port version of Emacs and emacs-plus |
| 19 | + (with =unicode-fonts-force-multi-color-on-mac= set to non nil). |
20 | 20 | - Enable support for font ligature in Emacs 27 + via [[https://github.com/mickeynp/ligature.el][ligatures.el]].
|
21 | 21 |
|
22 | 22 | * Install
|
23 | 23 | To use this configuration layer, add it to your =~/.spacemacs=. You will need to
|
24 |
| -add =unicode-fonts= to the existing =dotspacemacs-configuration-layers= list in this |
25 |
| -file. |
| 24 | +add =unicode-fonts= to the existing =dotspacemacs-configuration-layers= list in |
| 25 | +this file. |
| 26 | + |
| 27 | +#+BEGIN_SRC emacs-lisp |
| 28 | + (setq-default dotspacemacs-configuration-layers '(unicode-fonts)) |
| 29 | +#+END_SRC |
26 | 30 |
|
27 | 31 | If using [[https://github.com/d12frosted/homebrew-emacs-plus/][emacs-plus]], you can set =unicode-fonts-force-multi-color-on-mac= to
|
28 | 32 | enable color emoji.
|
29 | 33 |
|
30 | 34 | #+BEGIN_SRC elisp
|
31 |
| - (unicode-fonts :variables unicode-fonts-force-multi-color-on-mac t) |
| 35 | + (setq-default dotspacemacs-configuration-layers |
| 36 | + '(unicode-fonts :variables |
| 37 | + unicode-fonts-force-multi-color-on-mac t)) |
32 | 38 | #+END_SRC
|
33 | 39 |
|
| 40 | +* Configuration |
| 41 | + |
34 | 42 | If you want ligature support Emacs must be built with =Harfbuzz= and a ligature
|
35 |
| -font must be installed and configured you can see the [[https://github.com/mickeynp/ligature.el#compatibility-and-version-requirements][upstream]] docs for a full |
36 |
| -list of requirements. By default this is not enabled you can enable it with |
| 43 | +font must be installed and configured. You can see the [[https://github.com/mickeynp/ligature.el#compatibility-and-version-requirements][upstream]] docs for a full |
| 44 | +list of requirements. By default this is not enabled, and you can enable it with |
37 | 45 | =unicode-fonts-enable-ligatures=.
|
38 | 46 |
|
39 | 47 | #+BEGIN_SRC elisp
|
40 |
| - (unicode-fonts :variables unicode-fonts-enable-ligatures t) |
| 48 | + (setq-default dotspacemacs-configuration-layers |
| 49 | + '(unicode-fonts :variables |
| 50 | + unicode-fonts-enable-ligatures t)) |
41 | 51 | #+END_SRC
|
42 | 52 |
|
43 |
| -By default ligatures will be enabled in all programing modes. |
44 |
| -You can enable ligatures for specific modes with |
45 |
| -=unicode-fonts-ligature-modes= variable. |
| 53 | +By default ligatures will be enabled in all programming modes. You can enable |
| 54 | +ligatures for specific modes with =unicode-fonts-ligature-modes= variable. For |
| 55 | +example, to enable ligatures only in PHP and Javascript files: |
46 | 56 |
|
47 | 57 | #+BEGIN_SRC elisp
|
48 |
| - (unicode-fonts :variables unicode-fonts-ligature-modes '(php-mode js-mode)) |
| 58 | + (setq-default dotspacemacs-configuration-layers |
| 59 | + '(unicode-fonts :variables |
| 60 | + unicode-fonts-enable-ligatures t |
| 61 | + unicode-fonts-ligature-modes '(php-mode js-mode))) |
49 | 62 | #+END_SRC
|
50 | 63 |
|
51 |
| -To enable only for text modes you can use =text-mode= |
| 64 | +Or to enable ligatures only for text files: |
52 | 65 |
|
53 | 66 | #+BEGIN_SRC elisp
|
54 |
| - (unicode-fonts :variables unicode-fonts-ligature-modes '(text-mode)) |
| 67 | + (setq-default dotspacemacs-configuration-layers |
| 68 | + '(unicode-fonts :variables |
| 69 | + unicode-fonts-enable-ligatures t |
| 70 | + unicode-fonts-ligature-modes '(text-mode))) |
55 | 71 | #+END_SRC
|
56 | 72 |
|
57 | 73 | To configure the ligature set that gets used with your font there is a
|
58 |
| -=unicode-fonts-ligature-set= variable. To only enable the ligatures in |
59 |
| -=if= statements you can limit the =unicode-fonts-ligature-set= |
| 74 | +=unicode-fonts-ligature-set= variable. For example To only enable the ligatures |
| 75 | +in =if= statements you can set the =unicode-fonts-ligature-set= as: |
60 | 76 |
|
61 | 77 | #+BEGIN_SRC elisp
|
62 |
| - (unicode-fonts :variables unicode-fonts-ligature-set '("==" "===" "!=" "!==" "||" "&&")) |
| 78 | + (setq-default dotspacemacs-configuration-layers |
| 79 | + '(unicode-fonts :variables |
| 80 | + unicode-fonts-enable-ligatures t |
| 81 | + unicode-fonts-ligature-set '("==" "===" "!=" "!==" "||" "&&"))) |
63 | 82 | #+END_SRC
|
64 |
| - |
65 |
| -* Ligature Fonts |
66 |
| -- [[https://github.com/tonsky/FiraCode][Fira Code]] |
67 |
| -- [[https://github.com/microsoft/cascadia-code][Cascadia Code]] |
68 |
| -- [[https://github.com/be5invis/Iosevka/][Iosevka]] |
|
0 commit comments