From: Lars Ingebrigtsen <larsi@gnus.org>
To: Evgeny Zajcev <lg.zevlg@gmail.com>
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 06:17:56 +0100 [thread overview]
Message-ID: <87o8iiihvf.fsf@gnus.org> (raw)
In-Reply-To: <CAO=W_Zpnp08kYWoTO4JpiVTtyJy9OomeFW92TZH2MH4=+-rbiA@mail.gmail.com> (Evgeny Zajcev's message of "Thu, 24 Dec 2020 20:12:08 +0300")
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
next prev parent reply other threads:[~2020-12-25 5:17 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 [this message]
2020-12-25 6:10 ` Evgeny Zajcev
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=87o8iiihvf.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=lg.zevlg@gmail.com \
/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.