From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.bugs Subject: bug#43148: 27.1; Widget text seems to disappear when building with Cairo and Xaw Date: Sat, 05 Dec 2020 15:51:30 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: <87bliqnsnv.fsf@PouarArch.i-did-not-set--mail-host-address--so-tickle-me> <83ft81wpv5.fsf@gnu.org> <87pn42np74.fsf@tcd.ie> <20201201141032.79c4fa5f@ventiloplattform.tastytea.de> <20201203091815.32af30af@ventiloplattform.tastytea.de> <20201204102824.47d79f28@ventiloplattform.tastytea.de> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25587"; mail-complaints-to="usenet@ciao.gmane.io" 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/26.3 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) Cc: "Basil L. Contovounesios" , Robert Pluim , Pouar Dragon , 43148@debbugs.gnu.org To: tastytea Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 05 07:52:28 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1klRQi-0006XU-4T for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 05 Dec 2020 07:52:28 +0100 Original-Received: from localhost ([::1]:56380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1klRQg-0002jI-T9 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 05 Dec 2020 01:52:26 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1klRQI-0002iz-4K for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2020 01:52:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34900) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1klRQH-00083J-Rl for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2020 01:52:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1klRQH-00024p-Pu for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2020 01:52:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: YAMAMOTO Mitsuharu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Dec 2020 06:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43148 X-GNU-PR-Package: emacs Original-Received: via spool by 43148-submit@debbugs.gnu.org id=B43148.16071510997954 (code B ref 43148); Sat, 05 Dec 2020 06:52:01 +0000 Original-Received: (at 43148) by debbugs.gnu.org; 5 Dec 2020 06:51:39 +0000 Original-Received: from localhost ([127.0.0.1]:46446 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1klRPu-00024E-O3 for submit@debbugs.gnu.org; Sat, 05 Dec 2020 01:51:39 -0500 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:53926) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1klRPq-000240-KA for 43148@debbugs.gnu.org; Sat, 05 Dec 2020 01:51:36 -0500 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 49EE3F08DE; Sat, 5 Dec 2020 15:51:30 +0900 (JST) (envelope-from mituharu@math.s.chiba-u.ac.jp) In-Reply-To: <20201204102824.47d79f28@ventiloplattform.tastytea.de> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:195017 Archived-At: On Fri, 04 Dec 2020 18:28:24 +0900, tastytea wrote: >=20 > [1 ] > On 2020-12-04 17:41+0900 YAMAMOTO Mitsuharu > wrote: >=20 > > On Thu, 03 Dec 2020 17:18:15 +0900, > > tastytea wrote: > > >=20 > > > On 2020-12-03 11:13+0900 YAMAMOTO Mitsuharu > > > wrote: > > > =20 > > > > On Tue, 01 Dec 2020 22:10:32 +0900, > > > > tastytea wrote: =20 > > > > >=20 > > > > > On 2020-11-28 17:22+0900 YAMAMOTO Mitsuharu > > > > > wrote: > > > > > =20 > > > > > > On Wed, 25 Nov 2020 11:30:07 +0900, > > > > > > Basil L. Contovounesios wrote: =20 > > > > > > >=20 > > > > > > > Robert Pluim writes: > > > > > > > =20 > > > > > > > >>>>>> On Tue, 01 Sep 2020 17:09:18 +0300, Eli Zaretskii > > > > > > > >>>>>> said: =20 > > > > > > > > =20 > > > > > > > > >> From: Pouar Dragon > > > > > > > > >> Date: Mon, 31 Aug 2020 21:34:46 -0500 > > > > > > > > >>=20 > > > > > > > > >> widgets when building with Xaw and Cairo seem to > > > > > > > > >> have missing text, looking like this > > > > > > > > >>=20 > > > > > > > > >> problem seems to go away when > > > > > > > > >> 5f4e8e2e088de9fb76cb631077c6eddd3219f594 is > > > > > > > > >> reverted=20 > > > > > > > > =20 > > > > > > > > Eli> Thanks. I hope Yamamoto-san will be able to > > > > > > > > Eli> take a look at this. =20 > > > > > > > > > > > > > > > > Putting on my 'let's simplify' hat, is this really a > > > > > > > > combination we want to spend time on? Lucid + Xaw + Cairo > > > > > > > > is decidedly non-mainstream (I=CA=BCm surprised it even > > > > > > > > builds). =20 > > > > > > >=20 > > > > > > > FWIW, I've been happily using Lucid + Xaw3D for several > > > > > > > years, and Cairo ever since it became stable in Emacs 27 > > > > > > > and the default configuration in Emacs 28. > > > > > > >=20 > > > > > > > I usually have menu-bar-mode off, but like other reports in > > > > > > > this thread, the menus look fine when I do open them, e.g. > > > > > > > after 'emacs -Q'. > > > > > > >=20 > > > > > > > Could the issue depend on e.g. the version of Cairo? (I > > > > > > > seem to have an older version than the OP.) =20 > > > > > >=20 > > > > > > Possibly. The OP seems to use cairo 1.17.3, which is not a > > > > > > release version (the latest is 1.16.0) and even not the > > > > > > snapshot one (the latest is 1.17.2 according to > > > > > > https://cairographics.org). =20 > > > > >=20 > > > > > I experience the same issue as the OP with lucid and cairo > > > > > 1.16.0, with and without xaw3d, on Gentoo Linux. The problem > > > > > goes away if I disable cairo. > > > > > The same happens with 28.0.50, commit > > > > > 1a3aa6043a51e5bb4007889dd7dcabb55dc44132. =20 > > > >=20 > > > > So, only digits are shown with "$ emacs -Q" ? =20 > > >=20 > > > Yes, exactly like the screenshot in the first message. > > > =20 > > > > Could you show us the output of "$ fc-match -s sans" ? > > > >=20 > > > > I tried the latest snapshot cairo 1.17.4 on XQuartz/macOS, and I > > > > don't see any problems. On my side, "$ fc-match -s sans" reports > > > > Arial Unicode.ttf at the first line. =20 > > >=20 > > > The list is huge, are the first 10 lines enough? > > >=20 > > > SourceSansPro-Regular.otf: "Source Sans Pro" "Regular" > > > NotoColorEmoji.ttf: "Noto Color Emoji" "Regular" > > > LiberationSans-Regular.ttf: "Liberation Sans" "Regular" > > > DejaVuSans.ttf: "DejaVu Sans" "Book" > > > DejaVuSans-Bold.ttf: "DejaVu Sans" "Bold" > > > DejaVuSans-Oblique.ttf: "DejaVu Sans" "Oblique" > > > DejaVuSans-BoldOblique.ttf: "DejaVu Sans" "Bold Oblique" > > > luxisr.ttf: "Luxi Sans" "Regular" > > > l048013t.pfa: "Luxi Sans" "Regular" > > > n019003l.pfb: "Nimbus Sans L" "Regular" =20 > >=20 > > Thanks. I conjectured Noto Color Emoji, which contains digit glyphs > > but not for letter ones, would come first. But that is not the case. > > I don't know why Source Sans Pro is not used then (libotf is for > > handling OTF features and not necessary just for displaying). > >=20 > > Anyway, could you try if the following patch works? >=20 > With the patch I get rectangles instead of letters. >=20 > I removed Noto Color Emoji from my font configuration in > ~/.config/fontconfig/fonts.conf and that did the trick. The menus are > showing text now with and without the patch. But I have no idea why, > all other programs work fine with that configuration: I could reproduce the problem with your configuration. Could you try the patch below? YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp diff --git a/lwlib/lwlib-utils.c b/lwlib/lwlib-utils.c index f15cb603a8..2b3aa55c3e 100644 --- a/lwlib/lwlib-utils.c +++ b/lwlib/lwlib-utils.c @@ -148,6 +148,7 @@ XtWidgetBeingDestroyedP (Widget widget) crxft_font_open_name (Display *dpy, int screen, const char *name) { XftFont *pub =3D NULL; + FcPattern *match =3D NULL; FcPattern *pattern =3D FcNameParse ((FcChar8 *) name); if (pattern) { @@ -162,12 +163,18 @@ crxft_font_open_name (Display *dpy, int screen, const= char *name) FcPatternAddDouble (pattern, FC_DPI, dpi); } FcDefaultSubstitute (pattern); + FcResult result; + match =3D FcFontMatch (NULL, pattern, &result); + FcPatternDestroy (pattern); + } + if (match) + { cairo_font_face_t *font_face - =3D cairo_ft_font_face_create_for_pattern (pattern); + =3D cairo_ft_font_face_create_for_pattern (match); if (font_face) { double pixel_size; - if ((FcPatternGetDouble (pattern, FC_PIXEL_SIZE, 0, &pixel_size) + if ((FcPatternGetDouble (match, FC_PIXEL_SIZE, 0, &pixel_size) !=3D FcResultMatch) || pixel_size < 1) pixel_size =3D 10; @@ -177,7 +184,7 @@ crxft_font_open_name (Display *dpy, int screen, const c= har *name) cairo_matrix_init_scale (&font_matrix, pixel_size, pixel_size); cairo_matrix_init_identity (&ctm); cairo_font_options_t *options =3D cairo_font_options_create (); - cairo_ft_font_options_substitute (options, pattern); + cairo_ft_font_options_substitute (options, match); pub->scaled_font =3D cairo_scaled_font_create (font_face, &font_matrix, &ctm, options); cairo_font_face_destroy (font_face); @@ -190,7 +197,7 @@ crxft_font_open_name (Display *dpy, int screen, const c= har *name) pub->height =3D lround (extents.height); pub->max_advance_width =3D lround (extents.max_x_advance); } - FcPatternDestroy (pattern); + FcPatternDestroy (match); } if (pub && pub->height <=3D 0) {