Generating X Logical Font Descriptions(XLFD) for Emacs with xfontsel

By Bozhidar

Emacs prior to version 23 was unable to use TTF fonts. The type1 fonts that it uses are described by a XLFD line containing all the info about the font – its family, slant, weight and stuff like that. Guessing all of these while trying to find the perfect font for Emacs is boring and the process can the eased substantially with the help of the xfontsel application, which is generally available by default on most Linux installations with X.

The xfontsel application provides a simple way  to  display  the  fonts
known  to  your  X  server, examine samples of each, and retrieve the X
Logical Font Description (“XLFD”) full name for a font.

In other words you simply fire it up, select the properties of the font you need, see a preview of you selection and receice  XLFD line that you can pass to an Emacs Lisp function set-default-font for instance.

I myself am a fan of the terminus font and the XLDF line that I generated with xfontsel looks like that:

“-*-terminus-medium-r-*-*-20-*-*-*-*-*-*-*”

Leave a Reply