|
From: | Dmitry Antipov |
Subject: | bug#19117: 25.0.50; emacs on x11 chooses different fonts for the same face sometimes |
Date: | Fri, 19 Dec 2014 18:28:38 +0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 |
On 12/17/2014 09:57 AM, Dima Kogan wrote:
Apparently the "0 0 0 0" represents a "scalable" font. Not 100% sure what this means in the context of X11. In Emacs, we load this font with XLoadQueryFont() in xfont_open(). I wrote a small program to see what this means on my box: #include <stdio.h> #include <stdlib.h> #include <X11/Xlib.h> #include <X11/Xatom.h> int main(void) { Display* dpy = XOpenDisplay(":0.0"); const char* font_input = "-adobe-courier-medium-i-normal-*-0-0-0-0-p-0-iso8859-1"; const char* font_output; unsigned long value; XFontStruct *font = XLoadQueryFont(dpy, font_input); XGetFontProperty (font, XA_FONT, &value); font_output = XGetAtomName (dpy, (Atom) value); fprintf(stderr, "font '%s' loaded as '%s'\n", font_input, font_output); return 0; } Here I load the scalable font that Emacs is choosing (and that xlsfonts says exists on my machine). Then after it is loaded, I ask what the font is called. The output is this: font '-adobe-courier-medium-i-normal-*-0-0-0-0-p-0-iso8859-1' loaded as '-urw-nimbus mono l-regular-o-normal--17-120-100-100-p-100-iso8859-1'
Hm. On my system (Fedora 21), there are no -adobe-courier-medium-i-normal-* fonts but: $ xlsfonts | grep -- -adobe-utopia-bold-i-normal- -adobe-utopia-bold-i-normal--0-0-0-0-p-0-iso10646-1 -adobe-utopia-bold-i-normal--0-0-0-0-p-0-iso10646-1 -adobe-utopia-bold-i-normal--0-0-0-0-p-0-iso8859-1 -adobe-utopia-bold-i-normal--0-0-0-0-p-0-iso8859-1 -adobe-utopia-bold-i-normal--10-100-75-75-p-58-iso10646-1 -adobe-utopia-bold-i-normal--12-120-75-75-p-70-iso10646-1 -adobe-utopia-bold-i-normal--14-100-100-100-p-78-iso10646-1 -adobe-utopia-bold-i-normal--14-100-100-100-p-78-iso8859-1 -adobe-utopia-bold-i-normal--15-140-75-75-p-82-iso10646-1 -adobe-utopia-bold-i-normal--17-120-100-100-p-93-iso10646-1 -adobe-utopia-bold-i-normal--17-120-100-100-p-93-iso8859-1 -adobe-utopia-bold-i-normal--19-140-100-100-p-109-iso10646-1 -adobe-utopia-bold-i-normal--19-140-100-100-p-109-iso8859-1 -adobe-utopia-bold-i-normal--19-180-75-75-p-105-iso10646-1 -adobe-utopia-bold-i-normal--25-180-100-100-p-139-iso10646-1 -adobe-utopia-bold-i-normal--25-180-100-100-p-139-iso8859-1 -adobe-utopia-bold-i-normal--25-240-75-75-p-140-iso10646-1 -adobe-utopia-bold-i-normal--33-240-100-100-p-186-iso10646-1 -adobe-utopia-bold-i-normal--33-240-100-100-p-186-iso8859-1 And running your program with -adobe-utopia-bold-i-normal--0-0-0-0-p-0-iso8859-1 produces: font '-adobe-utopia-bold-i-normal--0-0-0-0-p-0-iso8859-1' loaded as '-adobe-utopia-bold-i-normal--17-120-100-100-p-94-iso8859-1' Your X behaves pretty strange; I can't explain this just now. Also, what happens if you specify default font via ~/.Xdefaults and run with emacs -q (small 'q', not 'Q')? Dmitry
[Prev in Thread] | Current Thread | [Next in Thread] |