From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Werner LEMBERG Newsgroups: gmane.emacs.bugs Subject: bug#20628: 25.0.50; Incorrect line height for some fonts Date: Fri, 22 May 2015 23:49:59 +0200 (CEST) Message-ID: <20150522.234959.238191883.wl@gnu.org> References: <83bnhc4gx4.fsf@gnu.org> <555F7BFD.2090105@live.com> <83617k4e5g.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1432331489 9621 80.91.229.3 (22 May 2015 21:51:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 22 May 2015 21:51:29 +0000 (UTC) Cc: clement.pitclaudel@live.com, ohwoeowho@gmail.com, 20628@debbugs.gnu.org To: eliz@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 22 23:51:14 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 1YvuqX-0005gl-Gd for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 May 2015 23:51:13 +0200 Original-Received: from localhost ([::1]:36063 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvuqW-0004QL-Vf for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 May 2015 17:51:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48893) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvuqR-0004Ks-JS for bug-gnu-emacs@gnu.org; Fri, 22 May 2015 17:51:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YvuqO-0002rS-2y for bug-gnu-emacs@gnu.org; Fri, 22 May 2015 17:51:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43290) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvuqN-0002rO-Vf for bug-gnu-emacs@gnu.org; Fri, 22 May 2015 17:51:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YvuqN-0007Oh-No for bug-gnu-emacs@gnu.org; Fri, 22 May 2015 17:51:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Werner LEMBERG Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 May 2015 21:51: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.143233141728328 (code B ref 20628); Fri, 22 May 2015 21:51:03 +0000 Original-Received: (at 20628) by debbugs.gnu.org; 22 May 2015 21:50:17 +0000 Original-Received: from localhost ([127.0.0.1]:53265 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yvupb-0007Mo-HE for submit@debbugs.gnu.org; Fri, 22 May 2015 17:50:16 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:55987) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YvupY-0007MM-CF for 20628@debbugs.gnu.org; Fri, 22 May 2015 17:50:13 -0400 Original-Received: from gnu.org ([178.115.130.41]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0MC8iq-1Z4gGp1jd2-008sBJ; Fri, 22 May 2015 23:50:03 +0200 In-Reply-To: <83617k4e5g.fsf@gnu.org> X-Mailer: Mew version 6.5 on Emacs 25.0.50.1 / Mule 6.0 (HANACHIRUSATO) X-Provags-ID: V03:K0:IczNBZWWDbAuyz4cHa3imSJrW5ZZ6v8BfDrQpMqpDo5bqq8B3R7 x9KaRpPkTUkA7fEgC2WYfI9xZ7EddAGChoFHn73N0VcQ2/JJd7D40f9sQiC+WXXQV4gi3c6 zfgGgIVUs41rHWDsou5gBiFCaMr9PZThJTZl2QDafg40ZumJbq1+jOMYuf8PX/bW2kk147A uDG0PxjbtyUfonMiN/MLQ== X-UI-Out-Filterresults: notjunk:1; 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:103071 Archived-At: >> Here is an hypothesis. When I open Latin Modern in FontForge, I see >> two types of ascent and descent values: the ones in the "General" >> tab are 806 and 194, and the ones in the OS/2 tab, in particular >> Win Ascent and Win Descent, are 3560 and 3060. Such a discrepancy >> does not seem to exist in the few well-behaved fonts that I >> checked. Could it be that most applications use the first set of >> values, but Emacs relies on the second? Actually, there are *three* sets of font-wide ascender and descender values in TrueType fonts: (1) From the `hhea' table: The `ascent' and `descent' fields, together with `linegap'. Used by Apple, cf. https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6hhea.html These values are normally set by the font developer; there is no relation to the actual ascender and descender values of individual glyphs. (2) From the `OS/2' table: The `usWinAscent' and `usWinDescent' fields, for Windows. Originally, those values are the ymax and ymin values from all characters in the Windows ANSI character set. Today, however, it is often set to the ymax and ymin values of all glyphs in a font to avoid nasty clipping on (some? older?) Windows applications. (3) From the `OS/2' table: The `sTypoAscender' and `sTypoDescender' fields, together with `sTypoLinegap'. For Windows. These values are normally set by the font developer; there is no relation to the actual ascender and descender values of individual glyphs. Note that (1) and (3) are defined differently. Mac fonts often miss an `OS/2' table, making (2) and (3) unavailable. Additionally, many fonts have incompatible or erroneous values for any of the fields. It's really a mess, unfortunately. IMHO the bes solution is to completely ignore font-wide ascender and descender values. Instead, use the TeX approach: set the line gap to the current size of the font, multiplied by a factor of 1.2 (and make this configurable on a font-by-font basis in case it isn't already), and increase the linegap if individual glyphs need it. Werner