From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#29078: 25.2; font issue with FreeType 2.8; should not use the rounded ascender and descender Date: Tue, 31 Oct 2017 11:53:20 +0100 Message-ID: <874lqfmvvj.fsf@gmail.com> References: <87d153pqw0.fsf@cventin.lip.ens-lyon.fr> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1509447659 11313 195.159.176.226 (31 Oct 2017 11:00:59 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 31 Oct 2017 11:00:59 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) Cc: 29078@debbugs.gnu.org To: Vincent Lefevre Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 31 12:00:48 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 1e9UHg-0001Z8-FA for geb-bug-gnu-emacs@m.gmane.org; Tue, 31 Oct 2017 12:00:40 +0100 Original-Received: from localhost ([::1]:44747 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e9UHn-0008FV-LT for geb-bug-gnu-emacs@m.gmane.org; Tue, 31 Oct 2017 07:00:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60484) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e9UBL-0002Ez-UN for bug-gnu-emacs@gnu.org; Tue, 31 Oct 2017 06:54:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e9UBG-0003Bj-2x for bug-gnu-emacs@gnu.org; Tue, 31 Oct 2017 06:54:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34589) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e9UBF-0003Bc-Vs for bug-gnu-emacs@gnu.org; Tue, 31 Oct 2017 06:54:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e9UBF-0007Qr-Ky for bug-gnu-emacs@gnu.org; Tue, 31 Oct 2017 06:54:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 31 Oct 2017 10:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29078 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 29078-submit@debbugs.gnu.org id=B29078.150944721328528 (code B ref 29078); Tue, 31 Oct 2017 10:54:01 +0000 Original-Received: (at 29078) by debbugs.gnu.org; 31 Oct 2017 10:53:33 +0000 Original-Received: from localhost ([127.0.0.1]:43270 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e9UAm-0007Q4-T5 for submit@debbugs.gnu.org; Tue, 31 Oct 2017 06:53:33 -0400 Original-Received: from mail-wm0-f53.google.com ([74.125.82.53]:55359) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e9UAk-0007Pp-69 for 29078@debbugs.gnu.org; Tue, 31 Oct 2017 06:53:31 -0400 Original-Received: by mail-wm0-f53.google.com with SMTP id y83so22080185wmc.4 for <29078@debbugs.gnu.org>; Tue, 31 Oct 2017 03:53:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:gmane-reply-to-list:date:in-reply-to :message-id:user-agent:mime-version; bh=y9D7BGfgfhdzw+gcZJZYTOUMDkf0G8H8b/dFqr0/oGE=; b=s5eFm5N/RYTf+6SCxGa75VGnxojibixKgHTbokg1Su+bAiGq0Xjvrrn1f+0YM+I73x 105A38pbZZctlVDC49jxMkm+dpwmO4mkzYZu3+M5h1T82HNQj7JawpGZMwopDmB5UhbJ vJcY165F2aUdFS/CavMavY7xkoJOPLsZTMuVIKJqXIlGqaAKGe+XvzpYMuxuO0f+Qa2W ysGUGGtDqlkFji/YOsXZJcY1MDTDKX0g3uYRUeHp9wYrnv0l8TKGiMUnJloo9XC3SkTf DKkcU35mjzi2T53Htm50D8Yy4Juk9hgBvw77FAp+6n3egyJByjyt4NYCDA0n2WJORYLI vaXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references :gmane-reply-to-list:date:in-reply-to:message-id:user-agent :mime-version; bh=y9D7BGfgfhdzw+gcZJZYTOUMDkf0G8H8b/dFqr0/oGE=; b=NBT8o1EQ/pmcZ26A3o+CYbwuE7kpJDzKc24W4o/VezOqd/SnEZmUSsiti1zyeNrtPH OwCXyIBDL+ANxCayVAJI/5vTFgjnhA/V5W1gjSEYCa+1w7EGiAx1vbhAPyTCBGa16R38 qjxE/Fe4PVQLwkV7AmktrlhRyBhzoPgGjpBjNzsDonvzjYS15o7PelUBA21TENE5YV7s JcuoniLJ5GymOuV0SJam1Ttp3htxwQDRDZwG8VxqtuELpK9j/GPkDvz/UmGAUEBUiGF5 qVkMV43exsUTJ2608Hw8AU/dDrdo7SaZTfHSJqwtpfLNzXYxA16Y+tcBTFbCcEzSU3q3 BgsQ== X-Gm-Message-State: AMCzsaU174f+/bTFPMI3FqIigemzTIO6pbIVKJeThW7g+ZlnSAWNaR0R PhjIkLR5s2sUvyVY0pLoKo5rQ9su X-Google-Smtp-Source: ABhQp+TqgAIeY/qQ89m9SiAM5XZ5g2LOdqBm7eSTbgncCiEPinjAqk0Z+1rcNxkBUg/CsACjFplxUQ== X-Received: by 10.80.167.34 with SMTP id h31mr2531425edc.43.1509447203850; Tue, 31 Oct 2017 03:53:23 -0700 (PDT) Original-Received: from rpluim-ubuntu ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id o60sm964832eda.48.2017.10.31.03.53.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Oct 2017 03:53:22 -0700 (PDT) Gmane-Reply-To-List: yes In-Reply-To: <87d153pqw0.fsf@cventin.lip.ens-lyon.fr> (Vincent Lefevre's message of "Tue, 31 Oct 2017 11:12:47 +0100") 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:139253 Archived-At: Vincent Lefevre writes: > For TrueType fonts, FreeType 2.8 uses different rounding rules for > values in the FT_Size_Metrics structure, which is apparently used > by Emacs (since there are visible changes). In particular, one can > now have ascender + descender > height. The consequences are: > > 1. Tables look a bit ugly. > > 2. Windows (with the same number of text lines) are unnecessarily > higher than before. > > 3. This can break existing configurations, where Emacs would be > opened at start up, with an expected window size. > > I could notice changes at least with the default Mono font, which > appears to be DejaVu Sans Mono. > > Upstream now recommends to use the values from the FT_Face structure > and scale them manually: > I don't have FreeType2.8 to test, but you're saying we need to do this? diff --git a/src/ftfont.c b/src/ftfont.c index 35f5923376..d16bf09a1e 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -1153,18 +1153,9 @@ ftfont_open2 (struct frame *f, upEM = ft_face->units_per_EM; scalable = (INTEGERP (AREF (entity, FONT_AVGWIDTH_INDEX)) && XINT (AREF (entity, FONT_AVGWIDTH_INDEX)) == 0); - if (scalable) - { - font->ascent = ft_face->ascender * size / upEM + 0.5; - font->descent = - ft_face->descender * size / upEM + 0.5; - font->height = ft_face->height * size / upEM + 0.5; - } - 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; - } + font->ascent = ft_face->ascender * size / upEM + 0.5; + font->descent = - ft_face->descender * size / upEM + 0.5; + font->height = ft_face->height * size / upEM + 0.5; if (INTEGERP (AREF (entity, FONT_SPACING_INDEX))) spacing = XINT (AREF (entity, FONT_SPACING_INDEX)); else