11

I copied my ~/.emacs file from ubuntu linux; I've installed Consolas font (and it works in gnome terminal, and as a default Monospace font); but Emacs does not see it

(custom-set-faces '(default ((t (:inherit nil :stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 98 :width normal :foundry "microsoft" :family "Consolas"))) t))

That's how I set the font in emacs, but it does not work (It worked and still works in Ubuntu)

What can I do?

Font select menu (menu-set-font, I guess) looks very strange, consists of three options: Misc, Courier and Fontset, and there are no sign of my system fonts

2 Answers 2

9

As Gilles said, to use a TrueType font like Consolas in Emacs 23 you must link it with the Freetype and Fontconfig libraries. In Gentoo, you do that by turning on the xft USE flag when building Emacs. You'll need to turn that flag on (either globally or just for app-editors/emacs) and reinstall Emacs.

3
  • thanks! awesome! looking into USE flags solved not only this problem with emacs, thank you very much
    – valya
    Commented Mar 2, 2011 at 0:21
  • 1
    @valya, because it builds things from source and provides use flags, Gentoo is much more customizable than distros like Ubuntu. The downside is that it's easy to leave out a feature that it turns out you actually do want. Fortunately, that's usually not too hard to fix; you just adjust your use flags and reinstall whatever program is missing a feature.
    – cjm
    Commented Mar 2, 2011 at 0:47
  • It's okay then the app is small, but I sometimes had to leave my computer building (or re-building) certain things while I'm asleep, because it took hours
    – valya
    Commented Mar 2, 2011 at 13:53
3

Support for TrueType fonts such as your Consolas font — more generally, support for client-rendered fonts — requires Emacs to be compiled against the Freetype and Fontconfig libraries. This was introduced in Emacs 23. Before, only traditional, server-rendered fonts were supported. See the Emacs manual for more information about the two kinds of fonts and how to use them.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .