spacemacs/layers/+fonts/unicode-fonts
syl20bnr 97cd83e169 Apply GPLv3 terms explicitly to all elisp files 2021-03-25 22:59:32 -04:00
..
README.org Make unicode-font README state the changed default settings 2020-12-08 19:56:03 +01:00
config.el Apply GPLv3 terms explicitly to all elisp files 2021-03-25 22:59:32 -04:00
packages.el Apply GPLv3 terms explicitly to all elisp files 2021-03-25 22:59:32 -04:00

README.org

unicode-fonts layer

Description

This layer adds support for unicode-fonts package. It is recommended to install the fonts listed in the Quickstart section of the unicode-fonts README.

Features:

  • Display unicode glyphs using the best available font.
  • Easily override glyphs or sections of glyphs.
  • Display color emoji on both the macOS port version of Emacs and emacs-plus (with unicode-fonts-force-multi-color-on-mac set to non nil).
  • Enable support for font ligature in Emacs 27 + via ligatures.el.

Install

To use this configuration layer, add it to your ~/.spacemacs. You will need to add unicode-fonts to the existing dotspacemacs-configuration-layers list in this file.

If using emacs-plus, you can set unicode-fonts-force-multi-color-on-mac to enable color emoji.

  (unicode-fonts :variables unicode-fonts-force-multi-color-on-mac t)

If you want ligature support Emacs must be built with Harfbuzz and a ligature font must be installed and configured you can see the upstream docs for a full list of requirements. By default this is not enabled you can enable it with unicode-fonts-enable-ligatures.

  (unicode-fonts :variables unicode-fonts-enable-ligatures t)

By default ligatures will be enabled in all programing modes. You can enable ligatures for specific modes with unicode-fonts-ligature-modes variable.

  (unicode-fonts :variables unicode-fonts-ligature-modes '(php-mode js-mode))

To enable only for text modes you can use text-mode

  (unicode-fonts :variables unicode-fonts-ligature-modes '(text-mode))

To configure the ligature set that gets used with your font there is a unicode-fonts-ligature-set variable. To only enable the ligatures in if statements you can limit the unicode-fonts-ligature-set

  (unicode-fonts :variables unicode-fonts-ligature-set '("==" "===" "!=" "!==" "||" "&&"))