GNU bug report logs - #36284
27.0.50; [Cairo] Setting default face :family attribute in the init script is broken

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dgutov <at> yandex.ru>

Date: Wed, 19 Jun 2019 01:45:01 UTC

Severity: normal

Found in version 27.0.50

Done: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 36284 in the body.
You can then email your comments to 36284 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#36284; Package emacs. (Wed, 19 Jun 2019 01:45:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dmitry Gutov <dgutov <at> yandex.ru>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 19 Jun 2019 01:45:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; [Cairo] Setting default face :family attribute in the init
 script is broken
Date: Wed, 19 Jun 2019 04:32:24 +0300
When using a build with Cairo, putting

(set-face-attribute 'default nil :height 113 :family "Inconsolata LGC")

into the init script doesn't have any effect.

Evaluating (face-attribute 'default :family) in the new session after 
that still returns "Ubuntu Mono".

However, if I evaluate the set-face-attribute call form later in the new
frame, the font changes successfully.

In GNU Emacs 27.0.50 (build 68, x86_64-pc-linux-gnu, GTK+ Version 
3.22.30, cairo version 1.15.10)
 of 2019-06-19 built on zappa
Repository revision: 922121e7ddbc107da14ea9c1280d15c828e85063
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12001000
System Description: Ubuntu 18.04.2 LTS




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36284; Package emacs. (Wed, 19 Jun 2019 03:38:02 GMT) Full text and rfc822 format available.

Message #8 received at 36284 <at> debbugs.gnu.org (full text, mbox):

From: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 36284 <at> debbugs.gnu.org
Subject: Re: bug#36284: 27.0.50;
 [Cairo] Setting default face :family attribute in the init script is
 broken
Date: Wed, 19 Jun 2019 12:37:05 +0900
On Wed, 19 Jun 2019 10:32:24 +0900,
Dmitry Gutov wrote:
> 
> When using a build with Cairo, putting
> 
> (set-face-attribute 'default nil :height 113 :family "Inconsolata LGC")
> 
> into the init script doesn't have any effect.
> 
> Evaluating (face-attribute 'default :family) in the new session after
> that still returns "Ubuntu Mono".
> 
> However, if I evaluate the set-face-attribute call form later in the new
> frame, the font changes successfully.

It seems that some changes I made to xsetting.c in order to remove
dependency on libXft was too naive.  For this particular problem, the
patch below would work.  For stricter consistency with the behavior of
the Xft version, one would need to implement replacements for
XftDefaultSubstitute and XftDefaultSet.

				     YAMAMOTO Mitsuharu
				mituharu <at> math.s.chiba-u.ac.jp

diff --git a/src/xsettings.c b/src/xsettings.c
index 3e9012e3ab1..06c47c6c6ce 100644
--- a/src/xsettings.c
+++ b/src/xsettings.c
@@ -608,18 +608,16 @@ static void
 apply_xft_settings (struct x_display_info *dpyinfo,
                     struct xsettings *settings)
 {
-#if defined USE_CAIRO || defined HAVE_XFT
+#ifdef HAVE_XFT
   FcPattern *pat;
   struct xsettings oldsettings;
   bool changed = false;
 
   memset (&oldsettings, 0, sizeof (oldsettings));
   pat = FcPatternCreate ();
-#ifdef HAVE_XFT
   XftDefaultSubstitute (dpyinfo->display,
                         XScreenNumberOfScreen (dpyinfo->screen),
                         pat);
-#endif
   FcPatternGetBool (pat, FC_ANTIALIAS, 0, &oldsettings.aa);
   FcPatternGetBool (pat, FC_HINTING, 0, &oldsettings.hinting);
 #ifdef FC_HINT_STYLE
@@ -719,9 +717,7 @@ apply_xft_settings (struct x_display_info *dpyinfo,
       };
       char buf[sizeof format + d_formats * d_growth + lf_formats * lf_growth];
 
-#ifdef HAVE_XFT
       XftDefaultSet (dpyinfo->display, pat);
-#endif
       store_config_changed_event (Qfont_render,
 				  XCAR (dpyinfo->name_list_element));
       Vxft_settings
@@ -733,7 +729,7 @@ apply_xft_settings (struct x_display_info *dpyinfo,
     }
   else
     FcPatternDestroy (pat);
-#endif /* USE_CAIRO || HAVE_XFT */
+#endif /* HAVE_XFT */
 }
 
 /* Read XSettings from the display for DPYINFO.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36284; Package emacs. (Wed, 19 Jun 2019 10:48:02 GMT) Full text and rfc822 format available.

Message #11 received at 36284 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
Cc: 36284 <at> debbugs.gnu.org
Subject: Re: bug#36284: 27.0.50; [Cairo] Setting default face :family
 attribute in the init script is broken
Date: Wed, 19 Jun 2019 13:47:14 +0300
On 19.06.2019 6:37, YAMAMOTO Mitsuharu wrote:
> It seems that some changes I made to xsetting.c in order to remove
> dependency on libXft was too naive.  For this particular problem, the
> patch below would work.  For stricter consistency with the behavior of
> the Xft version, one would need to implement replacements for
> XftDefaultSubstitute and XftDefaultSet.

This patch works, thank you.

Please install whichever version seems most appropriate to you.




Reply sent to YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>:
You have taken responsibility. (Thu, 20 Jun 2019 03:03:02 GMT) Full text and rfc822 format available.

Notification sent to Dmitry Gutov <dgutov <at> yandex.ru>:
bug acknowledged by developer. (Thu, 20 Jun 2019 03:03:02 GMT) Full text and rfc822 format available.

Message #16 received at 36284-done <at> debbugs.gnu.org (full text, mbox):

From: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 36284-done <at> debbugs.gnu.org
Subject: Re: bug#36284: 27.0.50;
 [Cairo] Setting default face :family attribute in the init script is
 broken
Date: Thu, 20 Jun 2019 12:02:47 +0900
On Wed, 19 Jun 2019 19:47:14 +0900,
Dmitry Gutov wrote:
> 
> On 19.06.2019 6:37, YAMAMOTO Mitsuharu wrote:
> > It seems that some changes I made to xsetting.c in order to remove
> > dependency on libXft was too naive.  For this particular problem, the
> > patch below would work.  For stricter consistency with the behavior of
> > the Xft version, one would need to implement replacements for
> > XftDefaultSubstitute and XftDefaultSet.
> 
> This patch works, thank you.
> 
> Please install whichever version seems most appropriate to you.

Thanks for testing.  The previous patch is applied to master as
0701634aa78.  Closing the bug.

				     YAMAMOTO Mitsuharu
				mituharu <at> math.s.chiba-u.ac.jp




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 18 Jul 2019 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 342 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.