all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dima Kogan <dima@secretsauce.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 19117@debbugs.gnu.org
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	[thread overview]
Message-ID: <87ppbikb6g.fsf@secretsauce.net> (raw)
In-Reply-To: <87r3vykdse.fsf@secretsauce.net>

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.





  reply	other threads:[~2014-12-17  6:57 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-20  6:13 bug#19117: 25.0.50; emacs on x11 chooses different fonts for the same face sometimes Dima Kogan
2014-11-20 16:10 ` Eli Zaretskii
2014-12-07  7:28   ` Dima Kogan
2014-12-07 16:12     ` Eli Zaretskii
2014-12-17  5:36       ` Dima Kogan
2014-12-17  6:57         ` Dima Kogan [this message]
2014-12-18 16:24           ` Eli Zaretskii
2014-12-20  8:08             ` Jan Djärv
2014-12-19 15:28           ` Dmitry Antipov
2014-12-19 22:46             ` Dima Kogan
2014-12-22  8:01               ` Dmitry Antipov
2014-12-22  8:28               ` Jan Djärv
2014-12-26 19:43                 ` Dima Kogan
2014-12-27  2:17                   ` Stefan Monnier
2014-12-27  9:17                     ` Dima Kogan
2014-12-30  9:44                     ` Dima Kogan
2014-12-30 16:57                       ` Stefan Monnier
2014-12-30 18:33                         ` Dima Kogan
2014-12-30 20:05                           ` Eli Zaretskii
2014-12-31  4:06                             ` Dima Kogan
2015-01-02  9:43                               ` Eli Zaretskii
2015-01-02 21:07                                 ` Dima Kogan
2015-02-02  8:10                                   ` Dima Kogan
2015-02-03 17:53                                     ` Stefan Monnier
2015-02-05  2:41                                       ` handa
2015-02-15 13:47                                         ` K. Handa
2015-02-05 15:08                                       ` Jan D.
2015-02-05 20:41                                         ` Dima Kogan
2015-02-07  7:24                                           ` Jan D.
2015-02-07  7:59                                           ` Jan D.
2015-02-07  8:28                                             ` Dima Kogan
2015-02-09 14:58                                               ` Jan D.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ppbikb6g.fsf@secretsauce.net \
    --to=dima@secretsauce.net \
    --cc=19117@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.