bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#52493: 29.0.50; Setting Inconsolata up in init.el makes default face


From: martin rudalics
Subject: bug#52493: 29.0.50; Setting Inconsolata up in init.el makes default face rendered wrong
Date: Wed, 28 Dec 2022 11:08:34 +0100

> Here you go, three attachments.

Thank you, they now contain all we need.

> As you previously guessed, the effect didn't show up when the scaling was 
off, or when resize-pixelwise was enabled.

In both cases we don't scale.  Scaling introduces a rounding effect
mutter apparently doesn't like.  Take, for example, these lines of
foo-with-scaling.txt produced when we set a new font (actually the first
line belongs to the previous request and is here only to show that we
start with a frame of 35 lines):

adjust_frame_size .. old pixels/lines .. 1296 .. 36 .. new pixels/lines .. 1584 
.. 35
x_new_font .. line_height .. 37 .. lines .. 35 .. new_text_height .. 1295
xg_wm_set_size_hint .. line_height & scale .. 37 .. 2 .. base_height .. 84 .. 
height_inc .. 18
  menubar_height .. 50 .. toolbar_height .. 82
xg_frame_set_char_size .. old .. 1584 .. arg .. 1295 .. new .. -1
  outer .. 713 .. gheight .. 858
xg_frame_resized .. old .. 1584 .. req .. -1 .. con/text .. 1260 .. 1260
adjust_frame_size .. old pixels/lines .. 1584 .. 35 .. new pixels/lines .. 1260 
.. 34

The base_height value (84 pixels) we calculate here is the sum of the
line_height value, the menubar_height value and the toolbar_height
values divided by the scale factor:

(/ (+ 37 50 82) 2)

height_inc (18) is the line height divided by the scale factor (/ 37 2).

These size hints have mutter expect us to resize our frame to something
like

(+ base_height (* height_inc N))

for some positive integer N.  Now we want to resize the frame to
line_height times lines, that is (* 37 35) yielding 1295 pixels.

But (% (/ 1295 2) 18) is not zero and so mutter declines our request
giving us 1260 pixels text height instead.  Apparently, mutter starts
with (/ 1295 2) that is 647, 630 is the next multiple of 18 it finds, so
(* 630 2) is the value it concedes us.

So the height we should ask for with scaling is 1296 instead of 1295.

Please try the attached patch - I can't test it here because I don't
scale.  If it doesn't work, please post the contents of *foo* as usual.

Thanks, martin

Attachment: x_scale_font.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]