Gentoo Logo

Using Emacs XFT Support

1.  Enabling Antialiased Fonts for Emacs

Installation and setup

Note: Font anti-aliasing using the Xft library and FreeType fonts is currently only available for the app-editors/emacs-cvs-23.0.9999 ebuild.

You'll need to first unmask and keyword the emacs-cvs-23 ebuild – it's experimental and potentially unstable.

Code Listing 1.1: Unmasking emacs-cvs-23

# echo "~app-editors/emacs-cvs-23.0.9999" >> /etc/portage/package.unmask
# echo "app-editors/emacs-cvs" >> /etc/portage/package.keywords

Next, set the appropriate USE flags - you must have the xft flag.

Code Listing 1.2: Adding appropriate USE flags

# echo "app-editors/emacs-cvs xft" >> /etc/portage/package.use

Now it's time to install the CVS version of emacs:

Code Listing 1.3: Emerging emacs-cvs-23

# emerge -av ~emacs-cvs-23.0.9999

You can now use XFT fonts in emacs; try emerging media-fonts/ttf-bitstream-vera first.

Code Listing 1.4: Enabling XFT fonts in emacs

$ emacs-23 --font 'Bitstream Vera Sans Mono-12'

If you're happy with this as your default font, set it in your ~/.Xresources:

Code Listing 1.5: Setting the default font for emacs startup

$ echo "Emacs.font: Bitstream Vera Sans Mono-12" >> ~/.Xresources
$ xrdb -merge ~/.Xresources

The emacs-cvs-23 branch is (currently) considered too unstable for production use; if you experience problems you may want to have a stable-but-not-antialiased version available as a standby. You can use eselect to switch between the various Emacs versions installed on your system.

Code Listing 1.6: eselect for switching emacs versions

(Check available versions)
$ eselect emacs list
Available GNU Emacs symlink targets:
  [1]   emacs-21
  [2]   emacs-22 *
  [3]   emacs-23

XEmacs is also installed

(Select the correct version)
# eselect emacs set emacs-23

Resources

For more details on Emacs with XFT pretty fonts, see:



Print

Updated April 22, 2008

Summary: This document shows you how to enable and use antialiased (pretty) fonts for Emacs.

Thomas Nichols
Author

Ulrich Müller
Author

Joshua Saddler
Editor

Christian Faulhammer
Contributor

Donate to support our development efforts.

Support OSL

Support OSL

Gentoo Centric Hosting: vr.org

VR Hosted

Tek Alchemy

Tek Alchemy

SevenL.net

SevenL.net

Global Netoptex Inc.

Global Netoptex Inc.

Bytemark

Bytemark

Linux World Expo

Linux World Expo

Copyright 2001-2008 Gentoo Foundation, Inc. Questions, Comments? Contact us.