emacs-devel
[Top][All Lists]
Advanced

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

Re: "Fix" sag scaling for hidpi


From: Alan Third
Subject: Re: "Fix" sag scaling for hidpi
Date: Tue, 9 Feb 2021 20:01:31 +0000

On Sat, Feb 06, 2021 at 12:35:41PM +0100, Lars Ingebrigtsen wrote:
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> "Logical" pixels was something that was introduced when people started
> making high-resolution screens.  In a 2x HiDPI scenario, the OS will
> report that the 1280 × 1024 is really a 640 x 512 screen, but if you
> give it an image that's 640x512 to display, it'll scale it up, using
> four physical pixels per logical pixel, and this will be blurry.
> 
> So you give it a 1280x1024 image if it's a logical 640x512 2x screen if
> you don't want blurriness.  :-/

One of the main problems I've had with trying to find a solution is to
work out what we want to actually happen.

If I open an image on an emacs frame it makes sense that the image
should be displayed 1:1 with the physical pixels no matter what the
scale factor is.

If that frame is then moved to another display with a different scale
factor do we then resize the image according to the change in scale
factor (so it's still 1:1 with the physical pixels), or keep it the
same (logical) size?

I think we probably want to keep it the same (logical) size, so I
think we need to, as described elsewhere, expose the scale factor to
lisp so that create-image can calculate :scale rather than trying to
calculate it on-the-fly in C code.

We'll probably have to do more fiddling with SVGs though, since they
can define sizes in real-world units, like cm or inches, so the dpi
has to match the physical pixels, and if we move to a different screen
and regenerate the SVG the DPI will be different but the scale likely
won't be recalculated and the image will change size.

Perhaps we need to let lisp set the DPI for an SVG (and other scalable
image types) as well as the scale.

And this is further complicated by the fact macOS uses a "fake" DPI
that has no relation to physical pixel size at all!

And, of course, none of this will help when the lisp code doesn't use
create-image.

I hope this makes sense, I find this hard to describe.
-- 
Alan Third



reply via email to

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