How to See Unicode in Emacs

If you have a reasonably new version of Emacs, and a reasonably new version of your operating system, and followed the README when installing Agda, then things usually just work (at least on Linux and Windows). However, if you have changed any settings yourself (like adding prefer-coding-system or set-language-environment to your .emacs), then they might not. Try commenting out such settings in your .emacs, or use a .emacs just containing the code snippets from the README.

Installing Unicode Fonts

If some unicode characters do not get displayed in Emacs, you might be missing the necessary fonts. I found some good advice which fonts to install in this file:

  http://www.emacswiki.org/emacs-es/unicode-fonts.el

My problem (dated 2012-11-03) under Mac OS X 10.6 was that emacs was picking, for certain common unicode characters, a font which did not contain them. These issues were resolved after installing the SymbolA font from:

  http://users.teilar.gr/~g1951d/

It was also suggested to install the free Deja Vu font from

   http://sourceforge.net/projects/dejavu/files/dejavu/2.33/dejavu-fonts-ttf-2.33.tar.bz2.

Add it as a fall-back font for emacs, such that unknown unicode characters in your favorite font are taken from Deja Vu instead. (2014-09-25, Paolo Capriotti)

  (set-fontset-font "fontset-default" 'unicode "DejaVu Sans")
  See http://stackoverflow.com/questions/6083496/how-do-you-specify-a-fallback-font-in-emacs

Finally, to avoid eyesore, disable unifont. ;-)

Emacs in Terminal

Running Emacs in a terminal can be problematic (fonts, colours, key combinations...), so this is discouraged. However, if you are a successful terminal user, then please use the wiki to inform others of how this can be done.

Actually, the colors are quite easily managed -- face definitions can be conditionalized over toolkit (where tty is a toolkit), light/dark background, etc. I've sent in a patch that gets all the faces to look okay on the terminal, where by "okay" I mean the text can all be read. It was mostly a matter of getting (a) not trying to use gray25 on a dark background and (b) specifying that the text on yellow backgrounds be black (otherwise it would default to a gray color for me). In fact, this should benefit dark-using non-tty users as well.

Type C-h C-f defface for details about how to do this.

--SamB

I took this TTF conversion of unifont and changed the "Proportion" field of the PANOSE header from "4 - Even width" to "9 - Monospaced" in Font Creator 5.6 (unregistered), even though the font is actually biwidth afaik, since this is evidently what PuTTY looks for in a font. The correct size for this font on Windows is 12. It seems to have pretty good character coverage, though I'm having some issues with @⟨@ c @⟩@ (the angles don't work for me, but then I think Emacs assumes they would be narrow when the only TTY fonts I've seen them in have them wide). You can download my font from http://naesten.dyndns.org:8080/unifont-mono.zip (I tried to attach the file but it didn't work, and I don't have much upload bandwidth so I'd like it if someone uploaded a copy to a better place and changed the link here.)

--SamB

Howto