From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#20628: 25.0.50; Incorrect line height for some fonts Date: Sun, 24 May 2015 13:06:57 +0300 Message-ID: <834mn21e7y.fsf@gnu.org> References: <20150522.234959.238191883.wl@gnu.org> <556189D0.2000208@live.com> <83bnha1fxw.fsf@gnu.org> <20150524.113203.250674550.wl@gnu.org> <83617i1f29.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1432462105 32135 80.91.229.3 (24 May 2015 10:08:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 May 2015 10:08:25 +0000 (UTC) Cc: 20628@debbugs.gnu.org To: wl@gnu.org, clement.pitclaudel@live.com, ohwoeowho@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 24 12:08:16 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YwSpK-0005dt-BD for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 May 2015 12:08:14 +0200 Original-Received: from localhost ([::1]:39537 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YwSpJ-0007j8-8R for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 May 2015 06:08:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49332) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YwSpC-0007cn-JQ for bug-gnu-emacs@gnu.org; Sun, 24 May 2015 06:08:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YwSp8-0003Nq-Sc for bug-gnu-emacs@gnu.org; Sun, 24 May 2015 06:08:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44265) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YwSp8-0003Nl-Pj for bug-gnu-emacs@gnu.org; Sun, 24 May 2015 06:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YwSp8-0008Eo-CI for bug-gnu-emacs@gnu.org; Sun, 24 May 2015 06:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 May 2015 10:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20628 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20628-submit@debbugs.gnu.org id=B20628.143246204131617 (code B ref 20628); Sun, 24 May 2015 10:08:02 +0000 Original-Received: (at 20628) by debbugs.gnu.org; 24 May 2015 10:07:21 +0000 Original-Received: from localhost ([127.0.0.1]:54240 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YwSoP-0008Dp-7z for submit@debbugs.gnu.org; Sun, 24 May 2015 06:07:21 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:49456) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YwSoJ-0008DY-ST for 20628@debbugs.gnu.org; Sun, 24 May 2015 06:07:15 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NOU00M00MN32000@a-mtaout20.012.net.il> for 20628@debbugs.gnu.org; Sun, 24 May 2015 13:07:04 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NOU00LASMRPUQ50@a-mtaout20.012.net.il>; Sun, 24 May 2015 13:07:04 +0300 (IDT) In-reply-to: <83617i1f29.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:103131 Archived-At: > Date: Sun, 24 May 2015 12:48:46 +0300 > From: Eli Zaretskii > Cc: clement.pitclaudel@live.com, ohwoeowho@gmail.com, 20628@debbugs.gnu.org > > > Have you seen my message w.r.t. the `ascent' and `descent' fields in > > the `font_metrics' structure of Emacs? Does this help? > > Yes, I've seen it; and yes, it helps. I need to try the solution > based on that. Actually, I need help with this, as I don't know enough about fonts, and don't have access to systems where per-character ascent/descent values are currently available in Emacs. So I'm going to describe here the information that should allow those who have access to affected systems to propose a patch. The relevant place in the display engine where these factors are taken into consideration is around line 26388 in xdisp.c, which is part of the function x_produce_glyphs. There you will find a call to the function get_per_char_metric, which in turn calls the font driver's text_extents method. The metrics returned by get_per_char_metric include ascent and descent, but I think they are not in pixel units. We currently assign these values to the phys_ascent and phys_descent of 'struct it', the iterator object used to walk the visible portion of the buffer and produce glyphs for display. I'm not sure what we do with phys_ascent and phys_descent values once we compute them, but you can search for them in xdisp.c to get the idea. By contrast, the height of the screen line is computed by summing it->ascent and it->descent, which currently are set using the font's ascent and descent values. The change we look for should: . set the initial values for it->ascent and it->descent using some heuristics based on pixel_size of the default face's font; . update it->ascent and it->descent based on ascent/descent values returned by get_per_char_metric in the per-character metrics data If people who want to work on this have questions about the display engine, please don't hesitate to ask. Thanks in advance!