From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.bugs Subject: 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 Organization: Faculty of Science, Chiba University Message-ID: References: Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="269130"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?Q?Goj=C5=8D?=) APEL/10.8 EasyPG/1.0.0 Emacs/25.3 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) Cc: 36284@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 19 05:38:20 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hdRQQ-0017qx-Mw for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 Jun 2019 05:38:18 +0200 Original-Received: from localhost ([::1]:34904 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdRQP-00088t-LK for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Jun 2019 23:38:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47855) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdRQB-0007la-J5 for bug-gnu-emacs@gnu.org; Tue, 18 Jun 2019 23:38:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdRQA-0007VR-Jw for bug-gnu-emacs@gnu.org; Tue, 18 Jun 2019 23:38:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60535) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hdRQA-0007VN-Gn for bug-gnu-emacs@gnu.org; Tue, 18 Jun 2019 23:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hdRQA-0002Pd-5I for bug-gnu-emacs@gnu.org; Tue, 18 Jun 2019 23:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: YAMAMOTO Mitsuharu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Jun 2019 03:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36284 X-GNU-PR-Package: emacs Original-Received: via spool by 36284-submit@debbugs.gnu.org id=B36284.15609154289178 (code B ref 36284); Wed, 19 Jun 2019 03:38:02 +0000 Original-Received: (at 36284) by debbugs.gnu.org; 19 Jun 2019 03:37:08 +0000 Original-Received: from localhost ([127.0.0.1]:45846 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hdRPH-0002Ny-R1 for submit@debbugs.gnu.org; Tue, 18 Jun 2019 23:37:08 -0400 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:57839) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hdRPF-0002No-Ma for 36284@debbugs.gnu.org; Tue, 18 Jun 2019 23:37:06 -0400 Original-Received: from mathent.math.s.chiba-u.ac.jp (mathent [192.168.32.5]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 3DFADF08DA; Wed, 19 Jun 2019 12:37:05 +0900 (JST) (envelope-from mituharu@math.s.chiba-u.ac.jp) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:160821 Archived-At: 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@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.