How to preview fixed width (mono spaced) fonts in an editable Emacs buffer?

09May

When using Emacs, I don’t spend time thinking about fonts most of the time. Like the majority, I pick my favorite fixed width, mono space font and get on with it. Every now and then I can hear about some cool new font for reading lots of software source code and technical writing, and I might give it a try, but that’s the end of it.

But sometimes, you just want to have an overview and see everything summed up in a single place, preferably an Emacs buffer so you can also play with it and hack it. Of course, your GNU/Linux, macOS, or MS Windows will happily show you all the available fonts, and let you filter out fixed width ones suitable for programming. Emacs itself can also do something very similar. But as I said, why not have something according to your taste?

With a bit of Emacs Lisp, it seems not that difficult, at least on GNU/Linux:

The result of running compare-monospace-font-families can be seen in the following screenshot:

Emacs fixed width fonts

Unfortunately, trying to do something similar for MS Windows is not that straightforward. The closest I could come is the following, and it lists some fonts that are not fixed width:

I hope you found this information useful. If you want to learn more about Emacs and fonts, feel free to visit the following web pages, too: