[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#19117: 25.0.50; emacs on x11 chooses different fonts for the same fa
From: |
Dima Kogan |
Subject: |
bug#19117: 25.0.50; emacs on x11 chooses different fonts for the same face sometimes |
Date: |
Tue, 16 Dec 2014 22:57:41 -0800 |
I just looked a bit more.
As I mentioned in the last message, the font description that results in
ugly rendering is
#<font-entity x adobe courier ## iso8859-1 medium i normal 0 0 0 0 nil>
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'
So this completely explains why I'm getting ugly rendering. Emacs is
picking a scalable adobe font, which XLoadQueryFont() interprets as a
17-pixel urw bitmap font. Since I was asking for an 11-pixel font to
begin with, emacs is down-scaling this font by a factor of 11/17, which
does not look so good.
- bug#19117: 25.0.50; emacs on x11 chooses different fonts for the same face sometimes, Dima Kogan, 2014/12/07
- bug#19117: 25.0.50; emacs on x11 chooses different fonts for the same face sometimes, Eli Zaretskii, 2014/12/07
- bug#19117: 25.0.50; emacs on x11 chooses different fonts for the same face sometimes, Dima Kogan, 2014/12/17
- bug#19117: 25.0.50; emacs on x11 chooses different fonts for the same face sometimes, Dmitry Antipov, 2014/12/19
- bug#19117: 25.0.50; emacs on x11 chooses different fonts for the same face sometimes, Dima Kogan, 2014/12/19
- bug#19117: 25.0.50; emacs on x11 chooses different fonts for the same face sometimes, Dmitry Antipov, 2014/12/22
- bug#19117: 25.0.50; emacs on x11 chooses different fonts for the same face sometimes, Jan Djärv, 2014/12/22
- bug#19117: 25.0.50; emacs on x11 chooses different fonts for the same face sometimes, Dima Kogan, 2014/12/26
- bug#19117: 25.0.50; emacs on x11 chooses different fonts for the same face sometimes, Stefan Monnier, 2014/12/26
- bug#19117: 25.0.50; emacs on x11 chooses different fonts for the same face sometimes, Dima Kogan, 2014/12/27
- bug#19117: 25.0.50; emacs on x11 chooses different fonts for the same face sometimes, Dima Kogan, 2014/12/30