2022-03-28 15:03:21 +02:00
|
|
|
#+title: :ui unicode
|
|
|
|
#+subtitle: Extended unicode support for various languages
|
|
|
|
#+created: June 08, 2020
|
|
|
|
#+since: 2.0.0
|
2021-10-16 01:29:57 +02:00
|
|
|
|
|
|
|
* Description :unfold:
|
|
|
|
This module extends Doom's ability to display non-English unicode. It is
|
|
|
|
primarily useful for non-English Emacs users, for whom Doom's built-in unicode
|
|
|
|
support in insufficient.
|
|
|
|
|
|
|
|
This module relies on the [[https://github.com/rolandwalker/unicode-fonts][unicode-fonts]] package. It tries to setup the default
|
|
|
|
emacs fontset to cover as many unicode glyphs as possible by scanning all
|
|
|
|
available glyphs from all available fonts.
|
|
|
|
|
|
|
|
When this module is enabled:
|
|
|
|
- Emacs will prefer to use the ~doom-unicode-font~ font to display non-latin
|
|
|
|
glyphs if it provides coverage for them.
|
|
|
|
- The first time you run Emacs a unicode cache will be generated -- this will
|
|
|
|
take a while!
|
|
|
|
- The cache will be regenerated every time Emacs is made aware of new fonts or
|
|
|
|
you change the font configuration e.g. by modifying ~doom-unicode-font~.
|
|
|
|
- The cache will be stored and should not be regenerated unless font-related
|
|
|
|
configuration or the versions of relevant packages changes.
|
2017-08-21 20:12:25 +02:00
|
|
|
|
2021-10-16 01:29:57 +02:00
|
|
|
** Maintainers
|
|
|
|
*This module needs a maintainer.* [[doom-contrib-maintainer:][Become a maintainer?]]
|
2020-06-12 14:56:13 -04:00
|
|
|
|
2021-10-16 01:29:57 +02:00
|
|
|
** Module flags
|
|
|
|
/This module has no flags./
|
2017-08-21 20:12:25 +02:00
|
|
|
|
2021-10-16 01:29:57 +02:00
|
|
|
** Packages
|
2022-09-26 02:19:42 +08:00
|
|
|
- [[doom-package:unicode-fonts]]
|
2020-06-12 12:45:37 -04:00
|
|
|
|
2021-10-16 01:29:57 +02:00
|
|
|
** Hacks
|
|
|
|
/No hacks documented for this module./
|
2020-06-12 12:45:37 -04:00
|
|
|
|
2021-10-16 01:29:57 +02:00
|
|
|
** TODO Changelog
|
|
|
|
# This section will be machine generated. Don't edit it by hand.
|
|
|
|
/This module does not have a changelog yet./
|
2020-06-12 12:45:37 -04:00
|
|
|
|
2021-10-16 01:29:57 +02:00
|
|
|
* Installation
|
|
|
|
[[id:01cffea4-3329-45e2-a892-95a384ab2338][Enable this module in your ~doom!~ block.]]
|
2020-06-12 12:45:37 -04:00
|
|
|
|
2021-10-16 01:29:57 +02:00
|
|
|
/This module has no external requirements./
|
2020-06-12 12:45:37 -04:00
|
|
|
|
2021-10-16 01:29:57 +02:00
|
|
|
* TODO Usage
|
|
|
|
#+begin_quote
|
|
|
|
🔨 This module has no usage documentation yet. [[doom-contrib-module:][Write some?]]
|
|
|
|
#+end_quote
|
2020-06-12 12:45:37 -04:00
|
|
|
|
2021-10-16 01:29:57 +02:00
|
|
|
* TODO Configuration
|
|
|
|
#+begin_quote
|
|
|
|
🔨 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
|
|
|
|
#+end_quote
|
2020-06-12 12:45:37 -04:00
|
|
|
|
2021-10-16 01:29:57 +02:00
|
|
|
The first font that will be analyzed to see if it contains the glyphs of
|
|
|
|
non-latin characters will be ~doom-unicode-font~:
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
;; in $DOOMDIR/config.el
|
2020-06-12 12:45:37 -04:00
|
|
|
(setq doom-unicode-font (font-spec :family "Fira Mono"))
|
2021-10-16 01:29:57 +02:00
|
|
|
#+end_src
|
|
|
|
|
|
|
|
If your ~doom-font~ provides good unicode coverage use:
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
;; in $DOOMDIR/config.el
|
2020-06-12 12:45:37 -04:00
|
|
|
(setq doom-unicode-font doom-font)
|
2021-10-16 01:29:57 +02:00
|
|
|
#+end_src
|
|
|
|
|
|
|
|
If your font does not provide some glyphs, this package will try its best to
|
|
|
|
find another font that does.
|
2020-06-12 12:45:37 -04:00
|
|
|
|
|
|
|
** Getting fonts with good coverage
|
2021-10-16 01:29:57 +02:00
|
|
|
A list of fonts with good unicode coverage can be found on the page of the
|
|
|
|
[[https://github.com/rolandwalker/unicode-fonts#minimum-useful-fonts][unicode-fonts]] package.
|
2020-06-12 12:45:37 -04:00
|
|
|
|
|
|
|
** Advanced configuration
|
2021-10-16 01:29:57 +02:00
|
|
|
Consult the [[https://github.com/rolandwalker/unicode-fonts][unicode-fonts]] package documentation for a description of more
|
|
|
|
advanced configuration. The configuration should be placed, as usual, in
|
|
|
|
=$DOOMDIR/config.el= wrapped in an ~(after! unicode-fonts)~ block. The variable
|
|
|
|
~unicode-fonts-blocks~ contains a list of all unicode block names and their
|
|
|
|
character ranges. The default fonts to search for glyphs are in the variable
|
|
|
|
~unicode-fonts-block-font-mapping~.
|
|
|
|
|
|
|
|
If you want to use the font =Symbola= for =Miscellaneous Symbols= by default
|
|
|
|
use:
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
;; in $DOOMDIR/config.el
|
2020-06-12 12:45:37 -04:00
|
|
|
(after! unicode-fonts
|
|
|
|
(push "Symbola" (cadr (assoc "Miscellaneous Symbols" unicode-fonts-block-font-mapping))))
|
2021-10-16 01:29:57 +02:00
|
|
|
#+end_src
|
2020-06-12 12:45:37 -04:00
|
|
|
|
2021-10-16 01:29:57 +02:00
|
|
|
If you want to redefine several blocks an efficient way would be:
|
|
|
|
#+begin_src emacs-lisp
|
2020-06-12 12:45:37 -04:00
|
|
|
(after! unicode-fonts
|
|
|
|
(dolist (unicode-block '("Mathematical Alphanumeric Symbols"
|
|
|
|
"Mathematical Operators"
|
|
|
|
"Miscellaneous Mathematical Symbols-A"
|
|
|
|
"Miscellaneous Mathematical Symbols-B"
|
|
|
|
"Miscellaneous Symbols"
|
|
|
|
"Miscellaneous Symbols and Arrows"
|
|
|
|
"Miscellaneous Symbols and Pictographs"))
|
|
|
|
(push "DejaVu Math TeX Gyre" (cadr (assoc unicode-block unicode-fonts-block-font-mapping)))))
|
2021-10-16 01:29:57 +02:00
|
|
|
#+end_src
|
2020-06-12 12:45:37 -04:00
|
|
|
|
|
|
|
You can find a list of fonts available to emacs using ~M-x counsel-fonts~.
|
|
|
|
|
|
|
|
* Troubleshooting
|
2021-10-16 01:29:57 +02:00
|
|
|
[[doom-report:][Report an issue?]]
|
|
|
|
|
2021-11-04 16:27:37 +01:00
|
|
|
** TODO Emacs daemon mode ([[doom-ref:][#3328]])
|
2021-10-16 01:29:57 +02:00
|
|
|
This module may fail to setup fonts when emacs is run in a daemon session.
|
|
|
|
|
|
|
|
* Frequently asked questions
|
|
|
|
/This module has no FAQs yet./ [[doom-suggest-faq:][Ask one?]]
|
|
|
|
|
|
|
|
* TODO Appendix
|
|
|
|
#+begin_quote
|
|
|
|
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
|
|
|
|
#+end_quote
|