1

This is a simple question: how to set the antialias attributes in emacs? I am using GNU emacs 24.4 in windows 7. If I put this line in init.el:
(set-face-attribute 'default nil :font "Georgia 15" :bold nil :antialias nil)
Emacs will complain set-face-attribute: Invalid face attribute name: :antialias.
Neither can I find this option in customize interface.
Any help is appreciated!

3

There is no face attribute :antialias. That's a font option, and must be set directly in the font name, i.e.

(set-frame-font "Georgia-15:antialias=none")

Note, though, that this option is only supported by the GDI font backend, which is not the default on modern GNU Emacs (read Emacs 23) and “modern” Windows versions (read Windows 2000). With the standard uniscribe backend, you cannot turn off anti-aliasing for Emacs—I wonder why you want to do that anyway. On modern screens fonts—particularly high-quality fonts— usually look very poor without antialiasing.

You can force Emacs to use the GDI backend by adding Emacs.fontBackend with a value gdi as string value to HKEY_CURRENT_USER\SOFTWARE\GNU\Emacs in the registry, but I'd recommend against it. GDI is outdated technology.

See Windows Fonts, for more details about font selection and configuration on Windows.

  • Thanks a lot for replying! The reason for asking is, I am using specific font for Chinese characters like this (set-face-attribute 'default nil :font "Georgia 15" :bold nil) (dolist (charset '(kana han symbol cjk-misc bopomofo)) (set-fontset-font (frame-parameter nil 'font) charset (font-spec :family "KaiTi"))) but the Chinese characters look terrible, and it feels antialias is not on. I want to toggle it on and off to check. – Alex Jan 19 '15 at 5:10
  • By the way, it seems that antialias for Chinese fonts are not turned on after all. Setting it to none or subpixel1 or natural does not make any difference. It makes an difference in the English letters though. I am using ttf fonts installed in the windows system. Any suggestions? Thanks! – Alex Jan 19 '15 at 5:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.