From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#25945: Emacs aborts while calling FT_Load_Glyph Date: Sat, 11 Mar 2017 21:08:03 +0200 Message-ID: <83shmjd430.fsf@gnu.org> References: <20170303.080429.592950574985497052.wl@gnu.org> <83bmtin5o5.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1489259366 22888 195.159.176.226 (11 Mar 2017 19:09:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 11 Mar 2017 19:09:26 +0000 (UTC) Cc: 25945@debbugs.gnu.org To: Kenichi Handa Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 11 20:09:18 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cmmO4-0004KZ-Qx for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Mar 2017 20:09:08 +0100 Original-Received: from localhost ([::1]:44445 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmmOA-0001KU-T7 for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Mar 2017 14:09:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmmO3-0001KC-AA for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2017 14:09:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cmmNx-0007JU-Qj for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2017 14:09:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53533) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cmmNx-0007JI-Nu for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2017 14:09:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cmmNx-0001eG-J4 for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2017 14:09:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 Mar 2017 19:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25945 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25945-submit@debbugs.gnu.org id=B25945.14892593276316 (code B ref 25945); Sat, 11 Mar 2017 19:09:01 +0000 Original-Received: (at 25945) by debbugs.gnu.org; 11 Mar 2017 19:08:47 +0000 Original-Received: from localhost ([127.0.0.1]:51732 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cmmNi-0001do-U4 for submit@debbugs.gnu.org; Sat, 11 Mar 2017 14:08:47 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:55600) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cmmNg-0001da-Jh for 25945@debbugs.gnu.org; Sat, 11 Mar 2017 14:08:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cmmNW-0006wR-91 for 25945@debbugs.gnu.org; Sat, 11 Mar 2017 14:08:39 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49129) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmmNI-0006dF-QR; Sat, 11 Mar 2017 14:08:20 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1630 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cmmNI-0001aT-3Q; Sat, 11 Mar 2017 14:08:20 -0500 In-reply-to: <83bmtin5o5.fsf@gnu.org> (message from Eli Zaretskii on Fri, 03 Mar 2017 10:08:42 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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: 208.118.235.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:130496 Archived-At: Ping! > Date: Fri, 03 Mar 2017 10:08:42 +0200 > From: Eli Zaretskii > Cc: 25945@debbugs.gnu.org > > > Date: Fri, 03 Mar 2017 08:04:29 +0100 (CET) > > From: Werner LEMBERG > > > > For me, Emacs aborts at ftfont.c:1550 while `mew' tries to display an > > e-mail. > > > > 1549 if (FT_Load_Glyph (ft_face, g->g.code, FT_LOAD_DEFAULT) != 0) > > 1550 emacs_abort (); > > > > Examining `ft_face' and `g->g.code' I see that the font in question is > > `Padauk Book Bold' (PadaukBook-Bold.ttf), glyph 376. Examining this > > font further with `ftview' I see that bytecode of this font is broken, > > and that the font can only be displayed successfully without bytecode. > > [This is version 3.002 of the font, taken from the current TeXLive > > repository.] > > > > I think there is no reason that Emacs aborts for such broken fonts. > > Instead I suggest that (a) Emacs tries to load the glyph again without > > hinting, and (b) if that fails, it should display a missing glyph, > > using the standard rectangle with hex digits in it. > > > > New code for (a) is quite simple: > > > > if (FT_Load_Glyph (ft_face, g->g.code, FT_LOAD_DEFAULT) != 0) > > if (FT_Load_Glyph (ft_face, g->g.code, FT_LOAD_NO_HINTING) != 0) > > ... > > This should probably be accompanied by a suitable FONT_ADD_LOG call, > to mention that this fallback was taken. > > > [The code might be further improved by implementing a per-font glyph > > load mode, to be initialized with `FT_LOAD_DEFAULT'. If, say, 100 > > calls using `FT_LOAD_DEFAULT' for a given font fails, and > > `FT_LOAD_NO_HINTING' is successful, the default loading behaviour for > > this font could be switched to `FT_LOAD_NO_HINTING'. Given that such > > broken fonts are rare my suggestion is probably overkill, however.] > > > > My knowledge of Emacs internals is too small to provide an > > implementation for (b). > > I think it's too late for (b) when we discover this problem in > ftfont_get_metrics. To do (b) we should have discovered this in > ftfont_has_char, or thereabouts. > > I'm CC'ing Handa-san in the hope that he will have insights and > comments on this. > > Thanks.