Unicode Font Redux

A couple of days ago I wrote about finally solving a long standing Emacs problem involving missing glyphs in my default font. I was really happy to have the problem resolved. So pleased I wrote about it in glowing terms.

That solution involved installing the unicode-fonts package, which scans your fonts for missing glyphs, finds them in other installed fonts, and arranges for them to be used in place of the missing glyphs. It's a really great package but it does much more than I need. I really just wanted to specify an alternate font for those missing glyphs.

As soon as I published my post, Xah Lee and Artur Malabarba suggested a simpler solution. I was happy with unicode-fonts but couldn't resist the one line solution that Lee and Malabarba offered. So I disabled unicode-fonts and added the line

(set-fontset-font "fontset-default" nil 
                  (font-spec :size 20 :name "Symbola"))

to my init.el. It worked perfectly, of course, so I uninstalled unicode-fonts and went with the Lee-Malabarba solution.

Malabarba notes that the documentation for set-fontset-font is a bit opaque. That's an understatement. I had to read it several times before I could figure out why it worked for my problem. No matter. If you're having the same problem you can just think of it as a magic incantation.

This entry was posted in General and tagged . Bookmark the permalink.
  • Thanks for the prompt – I had always intended to improve startup of unicode-fonts.el by adding a higher level of caching. I just tagged v0.4.2, which is on its way out to MELPA now. (Marmalade is broken for me these days.) With the additional cache there is no perceptible delay for me after the first invocation.

    If you keep your one-liner above, a good practice is to always disambiguate by adding a trailing colon to the font name, eg "Symbola:". This keeps Emacs from interpreting any part of the font name as a property.

    • jcs

      Thanks for the update and for the advice about adding a colon to the font name.