From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.devel Subject: Re: Redisplay issue Date: Mon, 07 Dec 2015 12:33:22 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: <83y4dhonng.fsf@gnu.org> <83two4olqj.fsf@gnu.org> <83h9k3mphx.fsf@gnu.org> <834mg2kvj7.fsf@gnu.org> <83d1upj6ml.fsf@gnu.org> <83si3kht2b.fsf@gnu.org> <56608701.9050802@gmx.at> <566149F0.1090408@gmx.at> <56615343.2090901@gmx.at> <5661554A.9050209@gmx.at> <5661574A.60900@gmx.at> <83y4dah7f8.fsf@gnu.org> <83lh99fe5m.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1449459224 3997 80.91.229.3 (7 Dec 2015 03:33:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Dec 2015 03:33:44 +0000 (UTC) Cc: martin rudalics , Eli Zaretskii , emacs-devel To: Yuan MEI Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 07 04:33:38 2015 Return-path: Envelope-to: ged-emacs-devel@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 1a5mYQ-0004Vu-Op for ged-emacs-devel@m.gmane.org; Mon, 07 Dec 2015 04:33:35 +0100 Original-Received: from localhost ([::1]:52267 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5mYP-0005Ny-V8 for ged-emacs-devel@m.gmane.org; Sun, 06 Dec 2015 22:33:33 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5mYL-0005LC-87 for emacs-devel@gnu.org; Sun, 06 Dec 2015 22:33:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a5mYK-00066R-DK for emacs-devel@gnu.org; Sun, 06 Dec 2015 22:33:29 -0500 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:55247) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5mYG-00061p-4R; Sun, 06 Dec 2015 22:33:24 -0500 Original-Received: from fermat1.math.s.chiba-u.ac.jp (fermat [192.168.32.10]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 698E8C0572; Mon, 7 Dec 2015 12:33:22 +0900 (JST) In-Reply-To: User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 133.82.132.2 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:195939 Archived-At: >>>>> On Sat, 5 Dec 2015 16:49:29 -0800, Yuan MEI said: >>> Maybe one font backend rounds the fractional metrics values but >>> the other truncates them? >> >> Could be. Yuan, could you try these changes, and see if the >> dimensions of the Cairo frame become identical to that of the >> non-Cairo build? > I tried the patch. However Cairo frame and non-Cairo frame still > differ by the same amount as reported before. So, rounding has nothing to do with the difference you observe. It seems that freetype has two types of structures containing metrics values (ascender, descender, height): FT_FaceRec and FT_Size_Metrics. ftfont.c uses the former for scalable fonts and the latter for the other cases. ftfont.c in Emacs: 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; } libXft internally uses the latter only. xftfreetype.c in libXft: if (fi->transform) { /* snip */ } else { descent = -(face->size->metrics.descender >> 6); ascent = face->size->metrics.ascender >> 6; if (fi->minspace) height = ascent + descent; else height = face->size->metrics.height >> 6; } font->public.ascent = ascent; font->public.descent = descent; font->public.height = height; I don't know which is correct/appropriate. At least, there is a case that these two kinds of values are different. YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp