Backup Fonts for Unicode Glyphs

Trey Harris posed a question on the Google+ Emacs Community that's been bothering me for some time. I use the terrific Inconsolata as the default for monospaced fonts but many of the Unicode glyphs are missing. Mac OS X takes care of finding missing glyphs in native apps like Terminal.app or Mail.app but with Emacs I just get a missing glyph. I've tried various fixes over the years but nothing worked very well.

Harris suggested using the unicode-fonts package to handle this. Happily, it's an ELPA package so I just loaded it up and added the required lines to my init.el and those missing glyphs starting appearing in Emacs. Years of frustration gone just like that.

There are still a few missing characters but the README for unicode-fonts lists a few font packages that you can load to supply most characters you're apt to need. Even without loading the extra fonts, I've got almost everything I need so I haven't bothered with them. If you've been having a problem with missing Unicode glyphs, give unicode-fonts a try. It's easy to load with ELPA and if it doesn't work for you, it's easy to uninstall. It's a huge win for me.

This entry was posted in General and tagged , . Bookmark the permalink.
  • Skywalker

    Surprisingly, it appears that emacs on linux doesn't have this problem. I just tested it by copy/pasting a few missing glyphs from the inconsolata specimen, and the glyphs indeed appeared. Because they were ugly and inconsistent, I don't believe my inconsolata package is simply containing more glyphs than the ones listed on google fonts.

    And as far as I can understand my setup, my emacs fonts are handled by emacs, not by xresources.

    • emacs on linux has problem for me. Mostly for emoticons, even i had the font Symbola that has the chars. I had to set init to specify Symbola for unicode.

  • doesn't this do the trick?

    ;; specify font for all unicode characters
    (when (member "Symbola" (font-family-list))
    (set-fontset-font t 'unicode "Symbola" nil 'prepend))

    or replace symbola with Mac's Emoji?

    • jcs

      I don't think I tried that particular magic spell so I'm not sure. The Symbola font is one of the fonts that the unicode-fonts README recommended downloading. It's not on my system so I can't do a quick test.

      • yes, Symbola is one of the great quality unicode font, mostly for all the hundred plus emoticons introduced in unicode 6, two years ago. But afaik, Mac's Emoji font is equivalent, if perhaps better since it's Apple...

  • that page has great font info. Thank you.