GNU bug report logs - #52493
29.0.50; Setting Inconsolata up in init.el makes default face rendered wrong

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dgutov <at> yandex.ru>

Date: Tue, 14 Dec 2021 23:45:01 UTC

Severity: normal

Found in version 29.0.50

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Dmitry Gutov <dgutov <at> yandex.ru>, Eli Zaretskii <eliz <at> gnu.org>
Cc: rpluim <at> gmail.com, 52493 <at> debbugs.gnu.org
Subject: bug#52493: 29.0.50; Setting Inconsolata up in init.el makes default face rendered wrong
Date: Fri, 17 Dec 2021 20:17:48 +0100
> When I evaluate
>
>    (set-face-attribute 'default nil :height 110 :family "InconsolataLGC")
>
> (this variation of the font doesn't have the original problem), the height of the window shrinks, unless the window is maximized.

When a frame is maximized, no implied resizing is done.  With

(push 'font frame-inhibit-implied-resize)

a non-maximized frame should also keep its size in your case.

> If I evaluate it multiple times, the height shrinks every time I do
> that

This might be a rounding error or some misunderstanding wrt what the WM
(mutter in your case?) thinks our frame size is and what Emacs thinks.
In x_new_font (in xterm.c) we do

  FRAME_COLUMN_WIDTH (f) = font->average_width;
  ...
  FRAME_LINE_HEIGHT (f) = font_ascent + font_descent;
  ...
      adjust_frame_size
      (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f),
       FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), 3, false, Qfont);

which should have the effect that (frame-height) and (frame-width)
remain unaltered when changing the default font.  Apparently, this fails
in your case.

> (stopping at height 5, when even the minibuffer becomes
> inaccessible

This is a separate issue I fixed here some time ago.  But I don't
remember whether I pushed it and/or whether it requires additional
customizations to make it DTRT (it might depend on the ability to drop
window decorations one by one when a frame is shrunk).

> ).

> If I evaluate
>
>    (set-face-attribute 'default nil :height 110 :family "Inconsolata_dz")
>
> (with your fix applied), it only shrinks twice (from 33 to 29 to 27, as reported by (window-height)). And then stops shrinking on subsequent attempts.
>
> Doing the same with InconsolataLGC on the latter build still makes it shrink indefinitely.

Here as above, stepping with GDB through the x_new_font code sketched
above might help tracking down this issue.

martin




This bug report was last modified 2 years and 249 days ago.

Previous Next


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