Tuesday, March 22, 2005

XTerm: Anti-aliasing

One of the things I kept missing in XTerm, compared to Konsole or gnome-terminal, was anti-aliased fonts. But you know what? They are, in fact, supported, as XTerm now — well, I suppose since XFree86 4.0 at least — uses freetype to render text.

So, how to do it? Just add the following lines to your ~/.Xresources file, as we did yesterday with the scrolling stuff:

XTerm*faceName: Bitstream Vera Sans Mono
XTerm*faceSize: 10

You can, of course, choose a different font name or size, but I think these look pretty good (although a bit big, compared to the default fixed font). And since it's using Freetype, you can use any font you like in your terminal! (Although some of them may look really bad.)

As usual, these are also available as command line options; just take a look at the manual page. You may discover other interesting stuff as well.

3 comments:

yakoub said...

i write in .Xresource
xterm*faceName:Luxi Mono
to use that font , but
i don't know how to make
it bold ,can you tell me ?

also i write rxvt*mfont: courier
but it fails to display
the font at all , how do i
set rxvt font ?

Julio M. Merino Vidal said...

"xterm*faceName: Luxi Mono:Bold" seems to do it.

No idea about rxvt.

openid said...

Under Mac OS X 10.6, I wasn't able to do this using .Xresources, but .Xdefaults did the trick.