From unknown Tue Jun 24 15:45:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22383: 25.1.50; Wrong font height for some fonts Resent-From: Fangwen Yu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Jan 2016 07:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 22383 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22383@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.145292803725931 (code B ref -1); Sat, 16 Jan 2016 07:08:01 +0000 Received: (at submit) by debbugs.gnu.org; 16 Jan 2016 07:07:17 +0000 Received: from localhost ([127.0.0.1]:50398 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aKKxA-0006kB-OS for submit@debbugs.gnu.org; Sat, 16 Jan 2016 02:07:17 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56901) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aKKx9-0006jw-HN for submit@debbugs.gnu.org; Sat, 16 Jan 2016 02:07:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aKKx2-0002Rx-Tj for submit@debbugs.gnu.org; Sat, 16 Jan 2016 02:07:10 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:57267) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aKKx2-0002Rt-Qq for submit@debbugs.gnu.org; Sat, 16 Jan 2016 02:07:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47860) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aKKx1-0005ar-6h for bug-gnu-emacs@gnu.org; Sat, 16 Jan 2016 02:07:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aKKwz-0002RS-Ln for bug-gnu-emacs@gnu.org; Sat, 16 Jan 2016 02:07:07 -0500 Received: from mail-io0-x231.google.com ([2607:f8b0:4001:c06::231]:35078) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aKKwz-0002RO-Dq for bug-gnu-emacs@gnu.org; Sat, 16 Jan 2016 02:07:05 -0500 Received: by mail-io0-x231.google.com with SMTP id 77so476277814ioc.2 for ; Fri, 15 Jan 2016 23:07:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=IHzMsRLXvRNs0YdQ+kntVV9QyPs6A3O2uJWqF60jqvw=; b=kTRevBrfMVcjunE8V5aUEyUTg03j5+xBRbvKj531od0Wrrm+JJxHE66ZXJJZVniln1 O53clsKu3ZauO+Jx8CaxnBD7ibFAEn7ooVnEERjgAUdEqcqvCs8HSDS+HXUnYNwC9P6d UqG46aR5eVxjW/kA9uYnNXK2hkDvqWc8eDMtNwCtzp4/MNlna2s98s7KtXHBx/yrV/Xt +R3faO3De5gONIK5fuWVtHGg9Oowp/Y0hEUyrkqAd0MwT2iaifNVchwbEXYaxMVH8206 Aafd3nJbmpiJhetFYIae78c5oHdBR8+6nBzibTw6RYUsFJlRGmS0aXhlQj3jb9xJvcUp rObg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=IHzMsRLXvRNs0YdQ+kntVV9QyPs6A3O2uJWqF60jqvw=; b=gp3+1Gc6yMhcE+fPEkMEeem1uBz8WhML4JzuZlRTITetYNhwjS77hvumwdNpvhgsea N3YokzuCKj8Nh8smrPw9nxtW2i8DSLH+ihNsYda4Qtgdyv7xKL8CP/67r5/383X5b+qx erSRSQGIjoRV/Y0uy+Z0jwBOJVSMFmrKhjDKMIKlyqkuF7lED/UBURpNPyc4QyTjntrT Ce1JxdqWU5y3fksq7LoVVodH7q497aRMz+nnO8qZbSlkwp0G+O8qbKaB2ot4tbnUV/UX 6c1e1PXM9HdHFBrwJAW4ct6B9eqKqZL4o3xNfLhfvtERi3HId4JXL+bDFE9CGMcq9l+2 9NNQ== X-Gm-Message-State: ALoCoQnwlw2/62ImBs9mS+MA6Wxm/D8p7QS5VSU2gliBkO1eX2iIVm3VmWzSefPlq3AFBrhUL9daLatYIZSpMVGh/qLy4m0zuQ== MIME-Version: 1.0 X-Received: by 10.107.46.228 with SMTP id u97mr13778695iou.136.1452928024676; Fri, 15 Jan 2016 23:07:04 -0800 (PST) Received: by 10.64.71.105 with HTTP; Fri, 15 Jan 2016 23:07:04 -0800 (PST) Date: Sat, 16 Jan 2016 15:07:04 +0800 Message-ID: From: Fangwen Yu Content-Type: multipart/alternative; boundary=001a11c15b50cb928d05296e2aaa X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --001a11c15b50cb928d05296e2aaa Content-Type: text/plain; charset=UTF-8 With DejaVu Sans Mono-11, text lines in Emacs are 1 pixel taller than in gedit or gnome-terminal, also, bold faces are 1 pixel taller than regular, so if the theme uses bold faces, texts will jump up and down while editing. The line height problem also happens with Consolas font, but the bold faces problem doesn't. Since it clearly has something to do with font height, I digged into the source and found the related code. Apply this patch, and the problem is gone: diff --git a/src/xftfont.c b/src/xftfont.c index 956231e..d0f9a68 100644 --- a/src/xftfont.c +++ b/src/xftfont.c @@ -395,16 +395,16 @@ xftfont_open (struct frame *f, Lisp_Object entity, int pixel_size) font->ascent = xftfont->ascent; font->descent = xftfont->descent; - if (pixel_size >= 5) - { - /* The above condition is a dirty workaround because - XftTextExtents8 behaves strangely for some fonts - (e.g. "Dejavu Sans Mono") when pixel_size is less than 5. */ - if (font->ascent < extents.y) - font->ascent = extents.y; - if (font->descent < extents.height - extents.y) - font->descent = extents.height - extents.y; - } + /* if (pixel_size >= 5) */ + /* { */ + /* /\* The above condition is a dirty workaround because */ + /* XftTextExtents8 behaves strangely for some fonts */ + /* (e.g. "Dejavu Sans Mono") when pixel_size is less than 5. *\/ */ + /* if (font->ascent < extents.y) */ + /* font->ascent = extents.y; */ + /* if (font->descent < extents.height - extents.y) */ + /* font->descent = extents.height - extents.y; */ + /* } */ font->height = font->ascent + font->descent; if (XINT (AREF (entity, FONT_SIZE_INDEX)) == 0) As the comment says, this piece of code is a dirty workaround, and apparently it is causing some new problems. In GNU Emacs 25.1.50.36 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.7) of 2016-01-15 built on katana Repository revision: 4580671f5e2a68885e0fca93eeaf9daaeebe82b3 Windowing system distributor 'The X.Org Foundation', version 11.0.11702000 System Description: Ubuntu 15.10 Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 Important settings: value of $LC_COLLATE: C value of $LC_CTYPE: zh_CN.UTF-8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=fcitx locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Making completion list... Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message dired dired-loaddefs format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode easymenu cl-loaddefs pcase cl-lib mail-prsvr mail-utils time-date mule-util china-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 80789 6761) (symbols 48 19157 0) (miscs 40 178 100) (strings 32 12817 4884) (string-bytes 1 387166) (vectors 16 11243) (vector-slots 8 468928 19771) (floats 8 142 27) (intervals 56 206 0) (buffers 976 12) (heap 1024 21736 1037)) --001a11c15b50cb928d05296e2aaa Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

With DejaVu Sans Mono-11, text lines in Emacs are 1 pi= xel taller than in
gedit or gnome-terminal, also, bold faces are 1 pixel= taller than
regular, so if the theme uses bold faces, texts will jump u= p and down
while editing. The line height problem also happens with Cons= olas font,
but the bold faces problem doesn't.

Since it clear= ly has something to do with font height, I digged into the
source and fo= und the related code. Apply this patch, and the problem is
gone:

= diff --git a/src/xftfont.c b/src/xftfont.c
index 956231e..d0f9a68 100644=
--- a/src/xftfont.c
+++ b/src/xftfont.c
@@ -395,16 +395,16 @@ xft= font_open (struct frame *f, Lisp_Object entity, int pixel_size)
=C2=A0=C2=A0=C2=A0 font->ascent =3D xftfont->ascent;
=C2=A0=C2=A0 font= ->descent =3D xftfont->descent;
-=C2=A0 if (pixel_size >=3D 5)<= br>-=C2=A0=C2=A0=C2=A0 {
-=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* The above co= ndition is a dirty workaround because
-=C2=A0=C2=A0=C2=A0 =C2=A0XftTextE= xtents8 behaves strangely for some fonts
-=C2=A0=C2=A0=C2=A0 =C2=A0(e.g.= "Dejavu Sans Mono") when pixel_size is less than 5. */
-=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 if (font->ascent < extents.y)
-=C2=A0= =C2=A0=C2=A0 font->ascent =3D extents.y;
-=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 if (font->descent < extents.height - extents.y)
-=C2=A0=C2=A0= =C2=A0 font->descent =3D extents.height - extents.y;
-=C2=A0=C2=A0=C2= =A0 }
+=C2=A0 /* if (pixel_size >=3D 5) */
+=C2=A0 /*=C2=A0=C2=A0 = { */
+=C2=A0 /*=C2=A0=C2=A0=C2=A0=C2=A0 /\* The above condition is a dir= ty workaround because */
+=C2=A0 /*=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 XftTextExtents8 behaves strangely for some fonts */
+=C2=A0 /*=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (e.g. "Dejavu Sans Mono")= when pixel_size is less than 5. *\/ */
+=C2=A0 /*=C2=A0=C2=A0=C2=A0=C2= =A0 if (font->ascent < extents.y) */
+=C2=A0 /*=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 font->ascent =3D extents.y; */
+=C2=A0 /*=C2=A0=C2= =A0=C2=A0=C2=A0 if (font->descent < extents.height - extents.y) */+=C2=A0 /*=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 font->descent =3D extent= s.height - extents.y; */
+=C2=A0 /*=C2=A0=C2=A0 } */
=C2=A0=C2=A0 fon= t->height =3D font->ascent + font->descent;
=C2=A0
=C2=A0=C2= =A0 if (XINT (AREF (entity, FONT_SIZE_INDEX)) =3D=3D 0)


As the c= omment says, this piece of code is a dirty workaround, and
apparently it= is causing some new problems.



In GNU Emacs 25.1.50.36 (x86_= 64-unknown-linux-gnu, GTK+ Version 3.16.7)
=C2=A0of 2016-01-15 built on = katana
Repository revision: 4580671f5e2a68885e0fca93eeaf9daaeebe82b3
= Windowing system distributor 'The X.Org Foundation', version 11.0.1= 1702000
System Description:=C2=A0=C2=A0=C2=A0 Ubuntu 15.10

Config= ured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCO= NF GSETTINGS
NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBO= TF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
= =C2=A0 value of $LC_COLLATE: C
=C2=A0 value of $LC_CTYPE: zh_CN.UTF-8=C2=A0 value of $LANG: en_US.UTF-8
=C2=A0 value of $XMODIFIERS: @im=3Df= citx
=C2=A0 locale-coding-system: utf-8-unix

Major mode: Lisp Int= eraction

Minor modes in effect:
=C2=A0 tooltip-mode: t
=C2=A0 = global-eldoc-mode: t
=C2=A0 electric-indent-mode: t
=C2=A0 mouse-whee= l-mode: t
=C2=A0 tool-bar-mode: t
=C2=A0 menu-bar-mode: t
=C2=A0 f= ile-name-shadow-mode: t
=C2=A0 global-font-lock-mode: t
=C2=A0 font-l= ock-mode: t
=C2=A0 blink-cursor-mode: t
=C2=A0 auto-composition-mode:= t
=C2=A0 auto-encryption-mode: t
=C2=A0 auto-compression-mode: t
= =C2=A0 line-number-mode: t
=C2=A0 transient-mark-mode: t

Recent m= essages:
For information about GNU Emacs and the GNU system, type C-h C-= a.
Making completion list...

Load-path shadows:
None found.
Features:
(shadow sort gnus-util mail-extr emacsbug message dired d= ired-loaddefs
format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-enco= de mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 r= fc2045
ietf-drums mm-util help-fns help-mode easymenu cl-loaddefs pcase = cl-lib
mail-prsvr mail-utils time-date mule-util china-util tooltip eldo= c
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win
= term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabul= ated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-b= ar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax f= acemenu font-core frame cl-generic cham georgian utf-8-lang
misc-lang vi= etnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebr= ew greek romanian slovak czech european ethiopic indian
cyrillic chinese= charscript case-table epa-hook jka-cmpr-hook help
simple abbrev obarray= minibuffer cl-preloaded nadvice loaddefs button
faces cus-face macroexp= files text-properties overlay sha1 md5 base64
format env code-pages mul= e custom widget hashtable-print-readable
backquote dbusbind inotify dyna= mic-setting system-font-setting
font-render-setting move-toolbar gtk x-t= oolkit x multi-tty
make-network-process emacs)

Memory information= :
((conses 16 80789 6761)
=C2=A0(symbols 48 19157 0)
=C2=A0(miscs = 40 178 100)
=C2=A0(strings 32 12817 4884)
=C2=A0(string-bytes 1 38716= 6)
=C2=A0(vectors 16 11243)
=C2=A0(vector-slots 8 468928 19771)
= =C2=A0(floats 8 142 27)
=C2=A0(intervals 56 206 0)
=C2=A0(buffers 976= 12)
=C2=A0(heap 1024 21736 1037))

--001a11c15b50cb928d05296e2aaa-- From unknown Tue Jun 24 15:45:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22383: 25.1.50; Wrong font height for some fonts Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Jan 2016 08:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22383 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Fangwen Yu , Kenichi Handa Cc: 22383@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 22383-submit@debbugs.gnu.org id=B22383.14529319275905 (code B ref 22383); Sat, 16 Jan 2016 08:13:01 +0000 Received: (at 22383) by debbugs.gnu.org; 16 Jan 2016 08:12:07 +0000 Received: from localhost ([127.0.0.1]:50427 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aKLxv-0001XB-DN for submit@debbugs.gnu.org; Sat, 16 Jan 2016 03:12:07 -0500 Received: from eggs.gnu.org ([208.118.235.92]:38036) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aKLxt-0001Wi-9x for 22383@debbugs.gnu.org; Sat, 16 Jan 2016 03:12:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aKLxn-00089o-AN for 22383@debbugs.gnu.org; Sat, 16 Jan 2016 03:12:00 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59507) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aKLxj-00085t-HK; Sat, 16 Jan 2016 03:11:55 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1931 helo=HOME-C4E4A596F7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aKLxi-0007lr-Jg; Sat, 16 Jan 2016 03:11:54 -0500 Date: Sat, 16 Jan 2016 10:11:54 +0200 Message-Id: <834meeeyet.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from Fangwen Yu on Sat, 16 Jan 2016 15:07:04 +0800) References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Date: Sat, 16 Jan 2016 15:07:04 +0800 > From: Fangwen Yu > > With DejaVu Sans Mono-11, text lines in Emacs are 1 pixel taller than in > gedit or gnome-terminal, also, bold faces are 1 pixel taller than > regular, so if the theme uses bold faces, texts will jump up and down > while editing. The line height problem also happens with Consolas font, > but the bold faces problem doesn't. > > Since it clearly has something to do with font height, I digged into the > source and found the related code. Apply this patch, and the problem is > gone: > > diff --git a/src/xftfont.c b/src/xftfont.c > index 956231e..d0f9a68 100644 > --- a/src/xftfont.c > +++ b/src/xftfont.c > @@ -395,16 +395,16 @@ xftfont_open (struct frame *f, Lisp_Object entity, int > pixel_size) > > font->ascent = xftfont->ascent; > font->descent = xftfont->descent; > - if (pixel_size >= 5) > - { > - /* The above condition is a dirty workaround because > - XftTextExtents8 behaves strangely for some fonts > - (e.g. "Dejavu Sans Mono") when pixel_size is less than 5. */ > - if (font->ascent < extents.y) > - font->ascent = extents.y; > - if (font->descent < extents.height - extents.y) > - font->descent = extents.height - extents.y; > - } > + /* if (pixel_size >= 5) */ > + /* { */ > + /* /\* The above condition is a dirty workaround because */ > + /* XftTextExtents8 behaves strangely for some fonts */ > + /* (e.g. "Dejavu Sans Mono") when pixel_size is less than 5. *\/ */ > + /* if (font->ascent < extents.y) */ > + /* font->ascent = extents.y; */ > + /* if (font->descent < extents.height - extents.y) */ > + /* font->descent = extents.height - extents.y; */ > + /* } */ > font->height = font->ascent + font->descent; > > if (XINT (AREF (entity, FONT_SIZE_INDEX)) == 0) > > As the comment says, this piece of code is a dirty workaround, and > apparently it is causing some new problems. Thanks for the report and the patch. I'm CC'ing Handa-san, who wrote that code, in the hope that he could comment on this issue. From unknown Tue Jun 24 15:45:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22383: 25.1.50; Wrong font height for some fonts References: Resent-From: handa Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Jan 2016 13:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22383 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: yynyygy@gmail.com, 22383@debbugs.gnu.org Received: via spool by 22383-submit@debbugs.gnu.org id=B22383.145398608416714 (code B ref 22383); Thu, 28 Jan 2016 13:02:01 +0000 Received: (at 22383) by debbugs.gnu.org; 28 Jan 2016 13:01:24 +0000 Received: from localhost ([127.0.0.1]:39204 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aOmCR-0004LW-P9 for submit@debbugs.gnu.org; Thu, 28 Jan 2016 08:01:23 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60561) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aOmCQ-0004LG-9K for 22383@debbugs.gnu.org; Thu, 28 Jan 2016 08:01:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOmC8-0006bw-TR for 22383@debbugs.gnu.org; Thu, 28 Jan 2016 08:01:17 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50810) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOmBt-0006N6-Jp; Thu, 28 Jan 2016 08:00:49 -0500 Received: from fl1-110-233-34-83.iba.mesh.ad.jp ([110.233.34.83]:42168 helo=shatin) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aOmBs-0000Kz-8p; Thu, 28 Jan 2016 08:00:48 -0500 Received: from handa by shatin with local (Exim 4.86) (envelope-from ) id 1aOmBn-0005FE-NE; Thu, 28 Jan 2016 22:00:44 +0900 From: handa In-Reply-To: <834meeeyet.fsf@gnu.org> (message from Eli Zaretskii on Sat, 16 Jan 2016 10:11:54 +0200) Date: Thu, 28 Jan 2016 22:00:43 +0900 Message-ID: <87bn85amf8.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Sorry for the late response. In article <834meeeyet.fsf@gnu.org>, Eli Zaretskii writes: > > Date: Sat, 16 Jan 2016 15:07:04 +0800 > > From: Fangwen Yu [...] > > diff --git a/src/xftfont.c b/src/xftfont.c > > index 956231e..d0f9a68 100644 > > --- a/src/xftfont.c > > +++ b/src/xftfont.c > > @@ -395,16 +395,16 @@ xftfont_open (struct frame *f, Lisp_Object entity, int > > pixel_size) > > > > font->ascent = xftfont->ascent; > > font->descent = xftfont->descent; > > - if (pixel_size >= 5) > > - { > > - /* The above condition is a dirty workaround because > > - XftTextExtents8 behaves strangely for some fonts > > - (e.g. "Dejavu Sans Mono") when pixel_size is less than 5. */ > > - if (font->ascent < extents.y) > > - font->ascent = extents.y; > > - if (font->descent < extents.height - extents.y) > > - font->descent = extents.height - extents.y; > > - } > > + /* if (pixel_size >= 5) */ > > + /* { */ > > + /* /\* The above condition is a dirty workaround because */ > > + /* XftTextExtents8 behaves strangely for some fonts */ > > + /* (e.g. "Dejavu Sans Mono") when pixel_size is less than 5. *\/ */ > > + /* if (font->ascent < extents.y) */ > > + /* font->ascent = extents.y; */ > > + /* if (font->descent < extents.height - extents.y) */ > > + /* font->descent = extents.height - extents.y; */ > > + /* } */ > > font->height = font->ascent + font->descent; > > > > if (XINT (AREF (entity, FONT_SIZE_INDEX)) == 0) > > > > As the comment says, this piece of code is a dirty workaround, and > > apparently it is causing some new problems. I've just tried the latest Xft with the attached small program. It seems that there's no need to adjust ascent and descent of fonts (including "dejavu sans mono"); i.e. we can trust xftfont->ascent and xftfont->descent. So, I think we can use your patch. --- K. Handa handa@gnu.org #include #include #include int main (int argc, char **argv) { Display *display = XOpenDisplay (NULL); FcPattern *pat = FcNameParse ((FcChar8 *) argv[1]); FcResult result; FcPattern *match = XftFontMatch (display, 0, pat, &result); XftFont *xftfont = XftFontOpenPattern (display, match); XGlyphInfo extents; XftTextExtents8 (display, xftfont, "ABCDEF", 6, &extents); printf ("%dx%d+%d+%d %d+%d\n", extents.width, extents.height, extents.x, extents.y, xftfont->ascent, xftfont->descent); } From unknown Tue Jun 24 15:45:08 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Fangwen Yu Subject: bug#22383: closed (Re: bug#22383: 25.1.50; Wrong font height for some fonts) Message-ID: References: <831t80ftj2.fsf@gnu.org> X-Gnu-PR-Message: they-closed 22383 X-Gnu-PR-Package: emacs Reply-To: 22383@debbugs.gnu.org Date: Thu, 25 Feb 2016 20:03:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1456430581-14318-1" This is a multi-part message in MIME format... ------------=_1456430581-14318-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #22383: 25.1.50; Wrong font height for some fonts which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 22383@debbugs.gnu.org. --=20 22383: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D22383 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1456430581-14318-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 22383-done) by debbugs.gnu.org; 25 Feb 2016 20:02:23 +0000 Received: from localhost ([127.0.0.1]:46392 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aZ27C-0003i4-PD for submit@debbugs.gnu.org; Thu, 25 Feb 2016 15:02:22 -0500 Received: from eggs.gnu.org ([208.118.235.92]:52556) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aZ27B-0003hs-0H for 22383-done@debbugs.gnu.org; Thu, 25 Feb 2016 15:02:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aZ275-00086t-0l for 22383-done@debbugs.gnu.org; Thu, 25 Feb 2016 15:02:15 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45348) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZ270-00086N-Op; Thu, 25 Feb 2016 15:02:10 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1427 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aZ26z-00016d-R3; Thu, 25 Feb 2016 15:02:10 -0500 Date: Thu, 25 Feb 2016 22:02:09 +0200 Message-Id: <831t80ftj2.fsf@gnu.org> From: Eli Zaretskii To: handa In-reply-to: <87bn85amf8.fsf@gnu.org> (message from handa on Thu, 28 Jan 2016 22:00:43 +0900) Subject: Re: bug#22383: 25.1.50; Wrong font height for some fonts References: <87bn85amf8.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 22383-done Cc: yynyygy@gmail.com, 22383-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) > From: handa > Cc: yynyygy@gmail.com, 22383@debbugs.gnu.org > Date: Thu, 28 Jan 2016 22:00:43 +0900 > > I've just tried the latest Xft with the attached small program. It > seems that there's no need to adjust ascent and descent of fonts > (including "dejavu sans mono"); i.e. we can trust xftfont->ascent and > xftfont->descent. So, I think we can use your patch. Thanks, installed. ------------=_1456430581-14318-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 16 Jan 2016 07:07:17 +0000 Received: from localhost ([127.0.0.1]:50398 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aKKxA-0006kB-OS for submit@debbugs.gnu.org; Sat, 16 Jan 2016 02:07:17 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56901) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aKKx9-0006jw-HN for submit@debbugs.gnu.org; Sat, 16 Jan 2016 02:07:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aKKx2-0002Rx-Tj for submit@debbugs.gnu.org; Sat, 16 Jan 2016 02:07:10 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:57267) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aKKx2-0002Rt-Qq for submit@debbugs.gnu.org; Sat, 16 Jan 2016 02:07:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47860) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aKKx1-0005ar-6h for bug-gnu-emacs@gnu.org; Sat, 16 Jan 2016 02:07:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aKKwz-0002RS-Ln for bug-gnu-emacs@gnu.org; Sat, 16 Jan 2016 02:07:07 -0500 Received: from mail-io0-x231.google.com ([2607:f8b0:4001:c06::231]:35078) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aKKwz-0002RO-Dq for bug-gnu-emacs@gnu.org; Sat, 16 Jan 2016 02:07:05 -0500 Received: by mail-io0-x231.google.com with SMTP id 77so476277814ioc.2 for ; Fri, 15 Jan 2016 23:07:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=IHzMsRLXvRNs0YdQ+kntVV9QyPs6A3O2uJWqF60jqvw=; b=kTRevBrfMVcjunE8V5aUEyUTg03j5+xBRbvKj531od0Wrrm+JJxHE66ZXJJZVniln1 O53clsKu3ZauO+Jx8CaxnBD7ibFAEn7ooVnEERjgAUdEqcqvCs8HSDS+HXUnYNwC9P6d UqG46aR5eVxjW/kA9uYnNXK2hkDvqWc8eDMtNwCtzp4/MNlna2s98s7KtXHBx/yrV/Xt +R3faO3De5gONIK5fuWVtHGg9Oowp/Y0hEUyrkqAd0MwT2iaifNVchwbEXYaxMVH8206 Aafd3nJbmpiJhetFYIae78c5oHdBR8+6nBzibTw6RYUsFJlRGmS0aXhlQj3jb9xJvcUp rObg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=IHzMsRLXvRNs0YdQ+kntVV9QyPs6A3O2uJWqF60jqvw=; b=gp3+1Gc6yMhcE+fPEkMEeem1uBz8WhML4JzuZlRTITetYNhwjS77hvumwdNpvhgsea N3YokzuCKj8Nh8smrPw9nxtW2i8DSLH+ihNsYda4Qtgdyv7xKL8CP/67r5/383X5b+qx erSRSQGIjoRV/Y0uy+Z0jwBOJVSMFmrKhjDKMIKlyqkuF7lED/UBURpNPyc4QyTjntrT Ce1JxdqWU5y3fksq7LoVVodH7q497aRMz+nnO8qZbSlkwp0G+O8qbKaB2ot4tbnUV/UX 6c1e1PXM9HdHFBrwJAW4ct6B9eqKqZL4o3xNfLhfvtERi3HId4JXL+bDFE9CGMcq9l+2 9NNQ== X-Gm-Message-State: ALoCoQnwlw2/62ImBs9mS+MA6Wxm/D8p7QS5VSU2gliBkO1eX2iIVm3VmWzSefPlq3AFBrhUL9daLatYIZSpMVGh/qLy4m0zuQ== MIME-Version: 1.0 X-Received: by 10.107.46.228 with SMTP id u97mr13778695iou.136.1452928024676; Fri, 15 Jan 2016 23:07:04 -0800 (PST) Received: by 10.64.71.105 with HTTP; Fri, 15 Jan 2016 23:07:04 -0800 (PST) Date: Sat, 16 Jan 2016 15:07:04 +0800 Message-ID: Subject: 25.1.50; Wrong font height for some fonts From: Fangwen Yu To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary=001a11c15b50cb928d05296e2aaa X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --001a11c15b50cb928d05296e2aaa Content-Type: text/plain; charset=UTF-8 With DejaVu Sans Mono-11, text lines in Emacs are 1 pixel taller than in gedit or gnome-terminal, also, bold faces are 1 pixel taller than regular, so if the theme uses bold faces, texts will jump up and down while editing. The line height problem also happens with Consolas font, but the bold faces problem doesn't. Since it clearly has something to do with font height, I digged into the source and found the related code. Apply this patch, and the problem is gone: diff --git a/src/xftfont.c b/src/xftfont.c index 956231e..d0f9a68 100644 --- a/src/xftfont.c +++ b/src/xftfont.c @@ -395,16 +395,16 @@ xftfont_open (struct frame *f, Lisp_Object entity, int pixel_size) font->ascent = xftfont->ascent; font->descent = xftfont->descent; - if (pixel_size >= 5) - { - /* The above condition is a dirty workaround because - XftTextExtents8 behaves strangely for some fonts - (e.g. "Dejavu Sans Mono") when pixel_size is less than 5. */ - if (font->ascent < extents.y) - font->ascent = extents.y; - if (font->descent < extents.height - extents.y) - font->descent = extents.height - extents.y; - } + /* if (pixel_size >= 5) */ + /* { */ + /* /\* The above condition is a dirty workaround because */ + /* XftTextExtents8 behaves strangely for some fonts */ + /* (e.g. "Dejavu Sans Mono") when pixel_size is less than 5. *\/ */ + /* if (font->ascent < extents.y) */ + /* font->ascent = extents.y; */ + /* if (font->descent < extents.height - extents.y) */ + /* font->descent = extents.height - extents.y; */ + /* } */ font->height = font->ascent + font->descent; if (XINT (AREF (entity, FONT_SIZE_INDEX)) == 0) As the comment says, this piece of code is a dirty workaround, and apparently it is causing some new problems. In GNU Emacs 25.1.50.36 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.7) of 2016-01-15 built on katana Repository revision: 4580671f5e2a68885e0fca93eeaf9daaeebe82b3 Windowing system distributor 'The X.Org Foundation', version 11.0.11702000 System Description: Ubuntu 15.10 Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 Important settings: value of $LC_COLLATE: C value of $LC_CTYPE: zh_CN.UTF-8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=fcitx locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Making completion list... Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message dired dired-loaddefs format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode easymenu cl-loaddefs pcase cl-lib mail-prsvr mail-utils time-date mule-util china-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 80789 6761) (symbols 48 19157 0) (miscs 40 178 100) (strings 32 12817 4884) (string-bytes 1 387166) (vectors 16 11243) (vector-slots 8 468928 19771) (floats 8 142 27) (intervals 56 206 0) (buffers 976 12) (heap 1024 21736 1037)) --001a11c15b50cb928d05296e2aaa Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

With DejaVu Sans Mono-11, text lines in Emacs are 1 pi= xel taller than in
gedit or gnome-terminal, also, bold faces are 1 pixel= taller than
regular, so if the theme uses bold faces, texts will jump u= p and down
while editing. The line height problem also happens with Cons= olas font,
but the bold faces problem doesn't.

Since it clear= ly has something to do with font height, I digged into the
source and fo= und the related code. Apply this patch, and the problem is
gone:

= diff --git a/src/xftfont.c b/src/xftfont.c
index 956231e..d0f9a68 100644=
--- a/src/xftfont.c
+++ b/src/xftfont.c
@@ -395,16 +395,16 @@ xft= font_open (struct frame *f, Lisp_Object entity, int pixel_size)
=C2=A0=C2=A0=C2=A0 font->ascent =3D xftfont->ascent;
=C2=A0=C2=A0 font= ->descent =3D xftfont->descent;
-=C2=A0 if (pixel_size >=3D 5)<= br>-=C2=A0=C2=A0=C2=A0 {
-=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* The above co= ndition is a dirty workaround because
-=C2=A0=C2=A0=C2=A0 =C2=A0XftTextE= xtents8 behaves strangely for some fonts
-=C2=A0=C2=A0=C2=A0 =C2=A0(e.g.= "Dejavu Sans Mono") when pixel_size is less than 5. */
-=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 if (font->ascent < extents.y)
-=C2=A0= =C2=A0=C2=A0 font->ascent =3D extents.y;
-=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 if (font->descent < extents.height - extents.y)
-=C2=A0=C2=A0= =C2=A0 font->descent =3D extents.height - extents.y;
-=C2=A0=C2=A0=C2= =A0 }
+=C2=A0 /* if (pixel_size >=3D 5) */
+=C2=A0 /*=C2=A0=C2=A0 = { */
+=C2=A0 /*=C2=A0=C2=A0=C2=A0=C2=A0 /\* The above condition is a dir= ty workaround because */
+=C2=A0 /*=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 XftTextExtents8 behaves strangely for some fonts */
+=C2=A0 /*=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (e.g. "Dejavu Sans Mono")= when pixel_size is less than 5. *\/ */
+=C2=A0 /*=C2=A0=C2=A0=C2=A0=C2= =A0 if (font->ascent < extents.y) */
+=C2=A0 /*=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 font->ascent =3D extents.y; */
+=C2=A0 /*=C2=A0=C2= =A0=C2=A0=C2=A0 if (font->descent < extents.height - extents.y) */+=C2=A0 /*=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 font->descent =3D extent= s.height - extents.y; */
+=C2=A0 /*=C2=A0=C2=A0 } */
=C2=A0=C2=A0 fon= t->height =3D font->ascent + font->descent;
=C2=A0
=C2=A0=C2= =A0 if (XINT (AREF (entity, FONT_SIZE_INDEX)) =3D=3D 0)


As the c= omment says, this piece of code is a dirty workaround, and
apparently it= is causing some new problems.



In GNU Emacs 25.1.50.36 (x86_= 64-unknown-linux-gnu, GTK+ Version 3.16.7)
=C2=A0of 2016-01-15 built on = katana
Repository revision: 4580671f5e2a68885e0fca93eeaf9daaeebe82b3
= Windowing system distributor 'The X.Org Foundation', version 11.0.1= 1702000
System Description:=C2=A0=C2=A0=C2=A0 Ubuntu 15.10

Config= ured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCO= NF GSETTINGS
NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBO= TF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
= =C2=A0 value of $LC_COLLATE: C
=C2=A0 value of $LC_CTYPE: zh_CN.UTF-8=C2=A0 value of $LANG: en_US.UTF-8
=C2=A0 value of $XMODIFIERS: @im=3Df= citx
=C2=A0 locale-coding-system: utf-8-unix

Major mode: Lisp Int= eraction

Minor modes in effect:
=C2=A0 tooltip-mode: t
=C2=A0 = global-eldoc-mode: t
=C2=A0 electric-indent-mode: t
=C2=A0 mouse-whee= l-mode: t
=C2=A0 tool-bar-mode: t
=C2=A0 menu-bar-mode: t
=C2=A0 f= ile-name-shadow-mode: t
=C2=A0 global-font-lock-mode: t
=C2=A0 font-l= ock-mode: t
=C2=A0 blink-cursor-mode: t
=C2=A0 auto-composition-mode:= t
=C2=A0 auto-encryption-mode: t
=C2=A0 auto-compression-mode: t
= =C2=A0 line-number-mode: t
=C2=A0 transient-mark-mode: t

Recent m= essages:
For information about GNU Emacs and the GNU system, type C-h C-= a.
Making completion list...

Load-path shadows:
None found.
Features:
(shadow sort gnus-util mail-extr emacsbug message dired d= ired-loaddefs
format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-enco= de mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 r= fc2045
ietf-drums mm-util help-fns help-mode easymenu cl-loaddefs pcase = cl-lib
mail-prsvr mail-utils time-date mule-util china-util tooltip eldo= c
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win
= term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabul= ated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-b= ar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax f= acemenu font-core frame cl-generic cham georgian utf-8-lang
misc-lang vi= etnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebr= ew greek romanian slovak czech european ethiopic indian
cyrillic chinese= charscript case-table epa-hook jka-cmpr-hook help
simple abbrev obarray= minibuffer cl-preloaded nadvice loaddefs button
faces cus-face macroexp= files text-properties overlay sha1 md5 base64
format env code-pages mul= e custom widget hashtable-print-readable
backquote dbusbind inotify dyna= mic-setting system-font-setting
font-render-setting move-toolbar gtk x-t= oolkit x multi-tty
make-network-process emacs)

Memory information= :
((conses 16 80789 6761)
=C2=A0(symbols 48 19157 0)
=C2=A0(miscs = 40 178 100)
=C2=A0(strings 32 12817 4884)
=C2=A0(string-bytes 1 38716= 6)
=C2=A0(vectors 16 11243)
=C2=A0(vector-slots 8 468928 19771)
= =C2=A0(floats 8 142 27)
=C2=A0(intervals 56 206 0)
=C2=A0(buffers 976= 12)
=C2=A0(heap 1024 21736 1037))

--001a11c15b50cb928d05296e2aaa-- ------------=_1456430581-14318-1--