all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
To: Robert Pluim <rpluim@gmail.com>
Cc: 36288@debbugs.gnu.org
Subject: bug#36288: 27.0.50; Cannot use menu-set-font
Date: Sun, 23 Jun 2019 15:34:23 +0900	[thread overview]
Message-ID: <wlk1dcg68g.wl-mituharu@math.s.chiba-u.ac.jp> (raw)
In-Reply-To: <wly31x6k6a.wl-mituharu@math.s.chiba-u.ac.jp>

On Thu, 20 Jun 2019 11:54:21 +0900,
YAMAMOTO Mitsuharu wrote:
> 
> On Wed, 19 Jun 2019 16:48:04 +0900,
> Robert Pluim wrote:
> > 
> > emacs -Q
> > M-x menu-set-font
> > select Ubuntu Mono Regular =>
> > 
> > "set-face-attribute: Font not available: #<font-spec xft nil Ubuntu\ Mono nil nil normal normal nil 10.0 nil nil nil ((:name . "Ubuntu Mono"))>"
> > 
> > I can select Ubuntu Mono using M-x customize-face. Why does
> > menu-set-font try to use an xft spec?
> > 
> > (frame-parameter nil 'font-backend) =>
> > (xfthb x)
> 
> Maybe better to use the first entry of the font-backend frame
> parameter rather than hardcoded one?

On second thought, it seems to be better to leave the font type
unspecified.  Hard-coding the wanted font type was introduced as a
"fix" for Bug#3228, but I suspect its reasoning is no longer valid (I
couldn't find fonts.alias in the Type1 font directory in CentOS or
Linux Mint).  Also, probably we should set the :family font property
instead of :name.

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp

diff --git a/src/gtkutil.c b/src/gtkutil.c
index dccee159254..1d15aec253e 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -2277,26 +2277,19 @@ xg_get_font (struct frame *f, const char *default_name)
 
       if (desc)
 	{
-	  const char *name   = pango_font_description_get_family (desc);
+	  const char *family = pango_font_description_get_family (desc);
 	  gint        size   = pango_font_description_get_size (desc);
 	  PangoWeight weight = pango_font_description_get_weight (desc);
 	  PangoStyle  style  = pango_font_description_get_style (desc);
 
-#ifdef USE_CAIRO
-#define FONT_TYPE_WANTED (Qftcr)
-#else
-#define FONT_TYPE_WANTED (Qxft)
-#endif
 	  font = CALLN (Ffont_spec,
-			QCname, build_string (name),
+			QCfamily, build_string (family),
 			QCsize, make_float (pango_units_to_double (size)),
 			QCweight, XG_WEIGHT_TO_SYMBOL (weight),
-			QCslant, XG_STYLE_TO_SYMBOL (style),
-			QCtype,
-                        FONT_TYPE_WANTED);
+			QCslant, XG_STYLE_TO_SYMBOL (style));
 
 	  pango_font_description_free (desc);
-	  dupstring (&x_last_font_name, name);
+	  dupstring (&x_last_font_name, family);
 	}
 
 #else /* Use old font selector, which just returns the font name.  */





  parent reply	other threads:[~2019-06-23  6:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-19  7:48 bug#36288: 27.0.50; Cannot use menu-set-font Robert Pluim
2019-06-20  2:54 ` YAMAMOTO Mitsuharu
2019-06-20  7:51   ` Robert Pluim
2019-06-20  8:32     ` Robert Pluim
2019-06-20 12:56       ` Eli Zaretskii
2019-06-20 14:19         ` Robert Pluim
2019-06-20 16:21           ` Eli Zaretskii
2019-06-21 13:52             ` Robert Pluim
2019-06-23  6:34   ` YAMAMOTO Mitsuharu [this message]
2019-06-23 13:50     ` Robert Pluim
2019-06-30  7:02       ` YAMAMOTO Mitsuharu

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=wlk1dcg68g.wl-mituharu@math.s.chiba-u.ac.jp \
    --to=mituharu@math.s.chiba-u.ac.jp \
    --cc=36288@debbugs.gnu.org \
    --cc=rpluim@gmail.com \
    /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.