emacs-devel
[Top][All Lists]
Advanced

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

Re: What is `image-compute-scaling-factor' for?


From: Evgeny Zajcev
Subject: Re: What is `image-compute-scaling-factor' for?
Date: Fri, 25 Dec 2020 09:10:16 +0300



пт, 25 дек. 2020 г. в 08:18, Lars Ingebrigtsen <larsi@gnus.org>:
Evgeny Zajcev <lg.zevlg@gmail.com> writes:

> Lars, could you please elaborate the logic in the
> `image-compute-scaling-factor'.  As I understand, it means "the larger
> font you have, the larger image you get"?  But why?  I use large fonts
> (say 30 pixels in width), in 1920x1080 screen,

(/ 1920.0 30) => 64.0

You only have 64 characters in width?

> and I'm totally ok with scale factor 1 for images, but `auto'
> image-scaling-factor gives me 3 as default scale.  This results in
> very large images.

The idea is that images scale somewhat along the lines of your
characters, so if you're reading text with interspersed images (for
instance, math equations), they'll be approximately the same size,
whether you're using a HiDPI display or not.  As a heuristic, that seems
to work surprisingly well.


But the problem is that this scaling logic is applied globally to all the images used inside Emacs, not only to some math equations.

I really can't get how this default behaviour could be ok, see screenshots: http://lgarc.narod.ru/pics/screenshot-scale.png

For example by default Emacs dashboard looks like: http://lgarc.narod.ru/pics/screenshot-scale-dashboard.png

For me, this looks surprisingly bad

(This is based on the assumption that your image resources come from a
non-HiDPI world, though.)

If you don't want that, then set the scaling factor to whatever you
want.

> For better `auto' scaling we should consider the physical size of the
> display and its resolution (that is called DPI I think?) not the size
> of the font.  But probably this info is not always available.  If we
> have that DPI info, we can then calculate `auto' scale factor using
> "typical DPI" (where images looks ok).  Something like:

The problem is that the functions that say how big a screen are are
often incorrect.  I've got a 14" 3840x2160 screen:

(display-mm-height)
=> 571

It's not half a meter high, I can assure you.

So, what the value you have now as return for (image-compute-scaling-factor 'auto) ?

With code I've provided you hit into typical DPI (your DPI=96 < 100) and get scaling factor 1.

--
lg

reply via email to

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