From: Evgeny Zajcev <lg.zevlg@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel <emacs-devel@gnu.org>
Subject: Re: What is `image-compute-scaling-factor' for?
Date: Fri, 25 Dec 2020 09:10:16 +0300 [thread overview]
Message-ID: <CAO=W_ZqMCRrqG92GhjONRf=w2FrO1L5Ln2+0f7XJayJPGYNKiA@mail.gmail.com> (raw)
In-Reply-To: <87o8iiihvf.fsf@gnus.org>
[-- Attachment #1: Type: text/plain, Size: 2323 bytes --]
пт, 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
[-- Attachment #2: Type: text/html, Size: 3365 bytes --]
next prev parent reply other threads:[~2020-12-25 6:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-24 9:30 What is `image-compute-scaling-factor' for? Evgeny Zajcev
2020-12-24 10:36 ` Eli Zaretskii
2020-12-24 10:52 ` Evgeny Zajcev
2020-12-24 11:07 ` tomas
2020-12-24 14:46 ` Eli Zaretskii
2020-12-24 17:12 ` Evgeny Zajcev
2020-12-25 5:17 ` Lars Ingebrigtsen
2020-12-25 6:10 ` Evgeny Zajcev [this message]
2020-12-25 6:15 ` Lars Ingebrigtsen
2020-12-25 6:36 ` Evgeny Zajcev
2020-12-25 17:12 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAO=W_ZqMCRrqG92GhjONRf=w2FrO1L5Ln2+0f7XJayJPGYNKiA@mail.gmail.com' \
--to=lg.zevlg@gmail.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=larsi@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.