Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop Emacs falling back to rasterized Unicode characters?

I'm trying to get a good Agda environment set up, but a big stumbling block is the readability of Unicode symbols in my Emacs setup.

I am on Mac OS X 10.7 with Emacs(.app) 23.3.1, and have configured my default font to Monaco using Set Default Font... from the Options menu. However, for Unicode symbols like ≤, ≠, and → it's falling back to some seriously ugly low-resolution rasterized glyphs that do not appear to be Monaco or any other monospace font I've checked. This is a huge readability problem for reading frequently Unicode-heavy Agda source.

How can I make Emacs use nice TTF glyphs instead?

Here's a screenshot showing a zoomed-in view of some characters in an Emacs buffer (on the right), and the same characters pasted into Font Book and displayed in Monaco (on the left):

Poorly-rendered characters

like image 701
acfoltzer Avatar asked Jan 08 '12 16:01

acfoltzer


1 Answers

Adding the following to my .emacs solved the problem, based on this superuser answer:

(if (string-equal system-type "darwin")
    (set-fontset-font "fontset-default"
                      'unicode
                      '("Monaco" . "iso10646-1")))

Apparently using the ⌘-T font selection menu is not enough to change the font for all characters, but this bit of configuration seems to affect the way all Unicode characters are displayed. Much better!

N.B.: For Agda purposes, it turns out that Menlo might be a better choice than Monaco, as Monaco seems to lack such useful characters as ∀.

like image 194
acfoltzer Avatar answered Nov 15 '22 17:11

acfoltzer