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: Lars Ingebrigtsen
Subject: Re: What is `image-compute-scaling-factor' for?
Date: Fri, 25 Dec 2020 06:17:56 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

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.

(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.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

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