bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#36288: 27.0.50; Cannot use menu-set-font


From: YAMAMOTO Mitsuharu
Subject: bug#36288: 27.0.50; Cannot use menu-set-font
Date: Thu, 20 Jun 2019 11:54:21 +0900
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (Gojō) APEL/10.8 EasyPG/1.0.0 Emacs/25.3 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

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?

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

diff --git a/src/gtkutil.c b/src/gtkutil.c
index dccee159254..de4b25f7794 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -2281,19 +2281,16 @@ xg_get_font (struct frame *f, const char *default_name)
          gint        size   = pango_font_description_get_size (desc);
          PangoWeight weight = pango_font_description_get_weight (desc);
          PangoStyle  style  = pango_font_description_get_style (desc);
+         Lisp_Object frame, font_type_wanted;
 
-#ifdef USE_CAIRO
-#define FONT_TYPE_WANTED (Qftcr)
-#else
-#define FONT_TYPE_WANTED (Qxft)
-#endif
+         XSETFRAME (frame, f);
+         font_type_wanted = XCAR (Fframe_parameter (frame, Qfont_backend));
          font = CALLN (Ffont_spec,
                        QCname, build_string (name),
                        QCsize, make_float (pango_units_to_double (size)),
                        QCweight, XG_WEIGHT_TO_SYMBOL (weight),
                        QCslant, XG_STYLE_TO_SYMBOL (style),
-                       QCtype,
-                        FONT_TYPE_WANTED);
+                       QCtype, font_type_wanted);
 
          pango_font_description_free (desc);
          dupstring (&x_last_font_name, name);





reply via email to

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