GNU bug report logs - #26605
25.1; emacs picks unsuitable fallback fonts for monospace default font

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Ralf Jung <post@HIDDEN>; dated Sat, 22 Apr 2017 13:08:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 22 Apr 2017 13:07:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 22 09:07:08 2017
Received: from localhost ([127.0.0.1]:33268 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1d1ukl-0001Pj-WC
	for submit <at> debbugs.gnu.org; Sat, 22 Apr 2017 09:07:08 -0400
Received: from eggs.gnu.org ([208.118.235.92]:50306)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <post@HIDDEN>) id 1d1ukk-0001PD-52
 for submit <at> debbugs.gnu.org; Sat, 22 Apr 2017 09:07:06 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <post@HIDDEN>) id 1d1ukd-0001em-Hj
 for submit <at> debbugs.gnu.org; Sat, 22 Apr 2017 09:07:00 -0400
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,T_DKIM_INVALID
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:41333)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <post@HIDDEN>) id 1d1ukd-0001ei-Dk
 for submit <at> debbugs.gnu.org; Sat, 22 Apr 2017 09:06:59 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:41275)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <post@HIDDEN>) id 1d1ukb-0003rY-RM
 for bug-gnu-emacs@HIDDEN; Sat, 22 Apr 2017 09:06:59 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <post@HIDDEN>) id 1d1ukY-0001b7-L5
 for bug-gnu-emacs@HIDDEN; Sat, 22 Apr 2017 09:06:57 -0400
Received: from eins.ralfj.de ([85.214.220.216]:39280)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <post@HIDDEN>) id 1d1ukY-0001al-9r
 for bug-gnu-emacs@HIDDEN; Sat, 22 Apr 2017 09:06:54 -0400
Received: from [192.168.10.97] (unknown [193.110.198.7])
 by mx.ralfj.de (Postfix) with ESMTPSA id 4EF1717D0940
 for <bug-gnu-emacs@HIDDEN>; Sat, 22 Apr 2017 15:06:51 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ralfj.de; s=mail;
 t=1492866411; bh=QHc2Yjpde1FB21YsWziWFqbq6fiQfsG0HKOf7ZJvAyM=;
 h=To:Subject:From:Date:From;
 b=Njq/POjKUlT4ts7miSFCGDRZQSd59FChAWGa4LCIPAX8OcJ2TtZGkER+UYufwoz1q
 QgQp0xYEAM9nrkM0NMBonWsUyf2ZJe20yN+s4OnvExWE53qpTkHipzJEXZx1QLe0bl
 lJ0IpsmH29MG7DZW1m7aB5jTkyvdZXsYRW0kMcz8=
To: bug-gnu-emacs@HIDDEN
Subject: 25.1; emacs picks unsuitable fallback fonts for monospace default font
From: Ralf Jung <post@HIDDEN>
Message-ID: <999a78da-e8c2-07b4-0716-8c2e3c40eb6a@HIDDEN>
Date: Sat, 22 Apr 2017 15:06:49 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.8.0
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

Hi all,

I have my system set up to use "Fira Mono" as the default font for
"Monospace", and my code editors (emacs and Kate) use that font as their
default font.  However, if I use emacs without any further
configuration, it picks unsuitable fallback fonts for characters not
supported my Fira Mono.  "Unsuitable" here means in particular that the
chosen fallback font is not monospace, so lines that contain fallback
characters break the grid.  At the same time, I do have suitable fonts
installed, as witnessed by Kate being able to preserve the grid.

Concretely, consider the following example text (pieced together from a
codebase using unicode characters for mathematical operators):

  mixin_cmra_pcore_mono x y cx :
    x =E2=89=BC y =E2=86=92 pcore x =3D Some cx =E2=86=92 =E2=88=83 cy, p=
core y =3D Some cy =E2=88=A7 cx =E2=89=BC cy;
    =E2=9C=93{n} x =E2=86=92 x =E2=89=A1{n}=E2=89=A1 y1 =E2=8B=85 y2 =E2=86=
=92
    z1 z2, x =E2=89=A1 z1 =E2=8B=85 z2 =E2=88=A7 z1 =E2=89=A1{n}=E2=89=A1=
 y1 =E2=88=A7 z2 =E2=89=A1{n}=E2=89=A1 y2
    =E2=88=80 =E2=9C=93{n} (=E2=88=85:A).
    }.

(At least) the following characters are not supported by Fira Mono, so a
fallback is picked:
  =E2=89=BC =E2=9C=93 =E2=8B=85 =E2=88=A7 =E2=88=85 =E2=88=83 =E2=88=80

As a result, the above text does not stay within the "monotext grid",
some characters are significantly wider than the majority (e.g., =E2=89=BC=
)
while others are much smaller (=E2=8B=85).  However, all of these charact=
ers are
supported by DejaVu Mono, a font I have installed.  I believe that's the
font other editors are using to render these characters.  When I
configure emacs to use DejaVu Mono for characters not supported by Fira
Mono, the text above looks entirely as expected.

Notice that, for example, =E2=86=92 is supported by both Fira Mono and De=
jaVu
Mono.  In these cases, the editor should use the preferred font, which
is Fira Mono in my case.  (Actually, the much prettier arrows are one of
the reasons I prefer Fira Mono over DejaVu Mono.)

Ideally, emacs' default configuration would be such that it prefers
monospace over non-monospace fonts when falling back from a monospace fon=
t.

Kind regards,
Ralf

In GNU Emacs 25.1.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.5)
 of 2017-01-01, modified by Debian built on binet
Windowing system distributor 'The X.Org Foundation', version 11.0.1190200=
0
System Description:	Debian GNU/Linux 9.0 (stretch)

Configured using:
 'configure --build x86_64-linux-gnu --prefix=3D/usr
 --sharedstatedir=3D/var/lib --libexecdir=3D/usr/lib
 --localstatedir=3D/var/lib --infodir=3D/usr/share/info
 --mandir=3D/usr/share/man --with-pop=3Dyes
 --enable-locallisppath=3D/etc/emacs25:/etc/emacs:/usr/local/share/emacs/=
25.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.1/sit=
e-lisp:/usr/share/emacs/site-lisp
 --with-sound=3Dalsa --build x86_64-linux-gnu --prefix=3D/usr
 --sharedstatedir=3D/var/lib --libexecdir=3D/usr/lib
 --localstatedir=3D/var/lib --infodir=3D/usr/share/info
 --mandir=3D/usr/share/man --with-pop=3Dyes
 --enable-locallisppath=3D/etc/emacs25:/etc/emacs:/usr/local/share/emacs/=
25.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.1/sit=
e-lisp:/usr/share/emacs/site-lisp
 --with-sound=3Dalsa --with-x=3Dyes --with-x-toolkit=3Dgtk3
 --with-toolkit-scroll-bars 'CFLAGS=3D-g -O2
 -fdebug-prefix-map=3D/build/emacs25-4Gc0bO/emacs25-25.1+1=3D.
-fstack-protector-strong
 -Wformat -Werror=3Dformat-security -Wall' 'CPPFLAGS=3D-Wdate-time
 -D_FORTIFY_SOURCE=3D2' LDFLAGS=3D-Wl,-z,relro'

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_MESSAGES: en_US.utf8
  value of $LC_NUMERIC: en_US.utf8
  value of $LANG: de_DE.utf8
  locale-coding-system: utf-8-unix

Major mode: Fundamental

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
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Loading /etc/emacs/site-start.d/50autoconf.el (source)...done
Loading /etc/emacs/site-start.d/50cmake-data.el (source)...done
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el
(source)...done
Loading debian-ispell...done
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el
(source)...done
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.
funcall-interactively: Buffer is read-only: #<buffer *GNU Emacs*>

Load-path shadows:
/usr/share/emacs/25.1/site-lisp/debian-startup hides
/usr/share/emacs/site-lisp/debian-startup
/usr/share/emacs25/site-lisp/cmake-data/cmake-mode hides
/usr/share/emacs/site-lisp/cmake-mode

Features:
(shadow sort mail-extr emacsbug message dired format-spec rfc822 mml
mml-sec password-cache epg gnus-util mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils finder-inf
info tex-site package epg-config seq byte-opt gv bytecomp byte-compile
cl-extra help-mode easymenu cconv cl-loaddefs pcase cl-lib time-date
mule-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 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 105584 5365)
 (symbols 48 21593 0)
 (miscs 40 98 107)
 (strings 32 21087 4829)
 (string-bytes 1 611322)
 (vectors 16 14637)
 (vector-slots 8 463510 5456)
 (floats 8 194 6)
 (intervals 56 296 0)
 (buffers 976 18))




Acknowledgement sent to Ralf Jung <post@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#26605; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 22 Apr 2017 13:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.