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: Fri, 22 May 2015 17:49:16 +0300 Message-ID: <83lhgg4qhf.fsf@gnu.org> References: <555E9C2E.8040008@live.com> <83617l5aox.fsf@gnu.org> <87pp5s2a77.fsf@gmail.com> <83wq004x2w.fsf@gnu.org> <83twv44vd3.fsf@gnu.org> <87egm87ny6.fsf@gmail.com> <83oalc4syu.fsf@gnu.org> <87617k7m5u.fsf@gmail.com> <83mw0w4seb.fsf@gnu.org> <87zj4w66ds.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1432306223 13281 80.91.229.3 (22 May 2015 14:50:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 22 May 2015 14:50:23 +0000 (UTC) Cc: clement.pitclaudel@live.com, 20628@debbugs.gnu.org To: Oleh Krehel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 22 16:50:12 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 1YvoH5-0000WZ-ME for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 May 2015 16:50:11 +0200 Original-Received: from localhost ([::1]:34333 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvoH5-0002Y3-0j for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 May 2015 10:50:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34011) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvoH1-0002Vt-IM for bug-gnu-emacs@gnu.org; Fri, 22 May 2015 10:50:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YvoGy-00020g-90 for bug-gnu-emacs@gnu.org; Fri, 22 May 2015 10:50:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43070) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvoGx-0001zA-Vv for bug-gnu-emacs@gnu.org; Fri, 22 May 2015 10:50:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YvoGx-0001Ud-8y for bug-gnu-emacs@gnu.org; Fri, 22 May 2015 10:50:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 May 2015 14:50:03 +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.14323061685693 (code B ref 20628); Fri, 22 May 2015 14:50:03 +0000 Original-Received: (at 20628) by debbugs.gnu.org; 22 May 2015 14:49:28 +0000 Original-Received: from localhost ([127.0.0.1]:53045 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YvoGN-0001Tk-7T for submit@debbugs.gnu.org; Fri, 22 May 2015 10:49:27 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:55447) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YvoGK-0001TR-5a for 20628@debbugs.gnu.org; Fri, 22 May 2015 10:49:25 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NOR00600A2TTU00@a-mtaout20.012.net.il> for 20628@debbugs.gnu.org; Fri, 22 May 2015 17:49:17 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NOR006L4AI4UZ00@a-mtaout20.012.net.il>; Fri, 22 May 2015 17:49:17 +0300 (IDT) In-reply-to: <87zj4w66ds.fsf@gmail.com> 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:103030 Archived-At: > From: Oleh Krehel > Cc: clement.pitclaudel@live.com, 20628@debbugs.gnu.org > Date: Fri, 22 May 2015 16:20:31 +0200 > > Eli Zaretskii writes: > > > Like this: > > > > it->max_ascent = max (it->max_ascent, it->ascent); > > it->max_descent = max (it->max_descent, it->descent); > > > > IOW, it's the max value of ascent and descent of all the characters on > > that screen line. > > OK, I got this far: > > p FACE_FROM_ID(it->f,it->face_id)->font->ascent > $18 = 15 > (gdb) p FACE_FROM_ID(it->f,it->face_id)->font->descent > $19 = 4 > > 15 and 4 are the eventual (wrong) values of it->max_ascent and > it->max_descent. Why do you think they are wrong? > But I don't know how and where the font structure is initialized and > how the current glyph actually is factored here: I just see a > reference to a frame and a face, no reference to the current char. AFAIK, they are initialized from the font data. Here's what ftfont.c does in ftfont_open: scalable = (INTEGERP (AREF (entity, FONT_AVGWIDTH_INDEX)) && XINT (AREF (entity, FONT_AVGWIDTH_INDEX)) == 0); if (scalable) { font->ascent = ft_face->ascender * size / upEM; font->descent = - ft_face->descender * size / upEM; font->height = ft_face->height * size / upEM; } else { font->ascent = ft_face->size->metrics.ascender >> 6; font->descent = - ft_face->size->metrics.descender >> 6; font->height = ft_face->size->metrics.height >> 6; } And the fields of ft_face seem to be set by FreeType library, via the call to FT_Set_Pixel_Sizes, a few lines before the above snippet.