[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: doc of x-family-fonts

From: Drew Adams
Subject: RE: doc of x-family-fonts
Date: Sun, 4 Jun 2006 14:12:19 -0700

Hi Eli,

    > I tried emacs -Q, then M-: (x-family-fonts). Result: nil.

    Set scalable-fonts-allowed non-nil, and you will see a more
    interesting result.

    In general, you've picked a wrong platform to learn about this,

I've no doubt picked the wrong platform to run Emacs on, but that's another

    because the Emacs font system comes from X, and the MS-Windows port
    tries to pretend it behaves the same (so that users could have the
    same font customizations in their .emacs as on X), but really doesn't
    and cannot.

One thing that's not clear to me is whether Emacs somehow makes additional
(X-Window) fonts available on Windows, besides the fonts installed in
C:\WINDOWS\Fonts\. Because I can apparently use things like x-list-fonts, I
get the impression that the answer is yes.

    Unfortunately, the Windows-specific aspects of the fonts
    support are completely undocumented in the manuals; volunteers are

Perhaps that is something that could be pointed out to emacs-devel, if that
hasn't been done already.

As I said, I found the Emacs font doc pretty poor in general, even aside
from Windows specifics. Perhaps documenting how fonts work is something to
suggest volunteers work on, after the release. The face doc is pretty good
now, but the font doc seems confusing and incomplete. And fonts themselves
seem a bit difficult to work with (in Emacs, at least - I haven't tried
outside of Emacs).

    I'm not sure I understand this issue enough myself, but see, for
    example, mouse-set-font on w32-win.el and w32-fixed-font-alist on
    w32-vars.el, for some revealing details and optional variables.

You've given a lot of good pointers. I'll check some of them out when I get
a chance, to try to learn a little more about this.

So far, all I've tried to do is this:

(defcustom my-font
  (car (x-list-fonts "-*-Courier-*-*-*-*-5-*-*-*-*-*-iso8859-1" nil nil 1))
  (car (x-list-fonts "-*-fixed-*-*-*-*-5-*-*-*-*-*-iso8859-1" nil nil 1))
  (car (x-list-fonts "-*-Terminal-*-*-*-*-5-*-*-*-*-*-iso8859-1" nil nil 1))
  (car (x-list-fonts "-*-*-*-*-*-*-5-*-*-*-*-*-iso8859-1" nil nil 1)))
 "My font" :type 'string)

And even that has not given me the result I hoped for: pick up Courier size
5, if present, if not, "fixed" size 5, if not, Terminal size 5, if not,
anything else size 5. From corresponding with Lennart, who tried this code,
I get the impression that it might not be working as I expected. It's hard
to figure this stuff out when you only have one system available, with its
fonts - I can't seem to figure out what happens on another system. Lennart
has Windows also, but he has different fonts, so the behavior he sees is

(BTW, I think I tried

    > When I try (x-list-fonts "*") I get a list of fonts, but it is
    > completely different from the list I get via Shift mouse-1. Why is
    > that? Just what is each list used for in Emacs?

    AFAIK, S-mouse-1 shows the native Windows font names (unless you set
    w32-use-w32-font-dialog to nil), while the other methods show X-style
    font names.  But I might be mistaken.

Yes, that was my impression. Are both sets of fonts available on Windows in
Emacs? If so, should there be a function that returns all of them? In code
that hopes to run on different platforms, should I stick to `x-list-fonts',
assuming that will give at least some of the available fonts on the given
platform, or is there some way to get all of the available fonts for a given

Thx - Drew

reply via email to

[Prev in Thread] Current Thread [Next in Thread]