unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Yuri Khan <yurivkhan@gmail.com>
To: Daniel Pittman <slippycheeze@google.com>
Cc: "Eli Zaretskii" <eliz@gnu.org>,
	"Clément Pit-Claudel" <cpitclaudel@gmail.com>,
	emacs-devel <emacs-devel@gnu.org>
Subject: Re: What is the proper way to scale fringe-bitmaps for high-DPI displays?
Date: Thu, 21 Mar 2019 20:33:33 +0700	[thread overview]
Message-ID: <CAP_d_8VJLwf007pzz1sCH_Vzc2y6YnOueafNCaKf2RLkQSMEKg@mail.gmail.com> (raw)
In-Reply-To: <CAC45yQu=cg6-OpFQcSrHZepUNRkkwT8Br40X+sjDF7KCGPJ0_w@mail.gmail.com>

On Thu, Mar 21, 2019 at 6:50 PM Daniel Pittman <slippycheeze@google.com> wrote:
>> But you were saying that a frame can move from a high-DPI terminal to
>> a low-DPI one, which seems to mean we cannot compute that just once.
>
> They can, at least on macOS, where that is entirely trivial to achieve by plugging an external (low DPI) monitor into a (high DPI) laptop with the panel open.  You could even enjoy the fun situation where your frame is displaying half the window on each of them, so technically has two different and concurrent densities.

I hear GTK+/Wayland also has this ability. Never tried it though.
GTK+/X is as far as I know constant DPI over the whole X display.

> What you really want here is a resolution independent unit for specifying the size of the output, or a macOS-alike ability to give multiple resolution bitmaps and have the most appropriate selected by Emacs, yeah?

I can see the following options:

* Migrate everything to SVG. Teach developers SVG is good, bitmaps are
bad. Package developer provides a single vector image. Failure mode:
developer is on a high DPI screen, makes a high-detail image, low DPI
users complain “image is blurry”.

* Keep bitmaps and upscale them for high DPI. Package developer
provides a single bitmap image. Failure mode 1: Nearest neighbor
upscaling looks ugly at non-integer factors. Failure mode 2: all other
upscaling algorithms look ugly pretty much always.

* Keep bitmaps and downscale them for low DPI. Package developer
provides a single, fairly large bitmap image. Failure mode: small
details get lost on low resolutions, image looks blurry.

* Migrate to multi-resolution bitmaps. Package developer has to
provide multiple bitmaps. Failure mode 1: Nobody knows what sizes they
need. Failure mode 2: Some will only include one for the low DPI. This
can be combined with up/downscaling, trading the corresponding failure
modes around.


> As a potentially useful aside in this context, HTML specifies that the "pixel" is a resolution-independent unit, and should probably approximate a 72 DPI display as the 1:1 logical:physical device.

Actually, the HTML pixel is specified as 1/96 of an inch.



  reply	other threads:[~2019-03-21 13:33 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-20 14:55 What is the proper way to scale fringe-bitmaps for high-DPI displays? Clément Pit-Claudel
2019-03-20 17:32 ` Eli Zaretskii
2019-03-20 19:34   ` Clément Pit-Claudel
2019-03-20 19:44     ` Eli Zaretskii
2019-03-20 20:05       ` Clément Pit-Claudel
2019-03-20 20:17         ` Eli Zaretskii
2019-03-20 21:17           ` Clément Pit-Claudel
2019-03-21  3:32             ` Eli Zaretskii
2019-03-21 11:43               ` Daniel Pittman
2019-03-21 13:33                 ` Yuri Khan [this message]
2019-03-21 14:32                   ` Eli Zaretskii
2019-03-21 17:32                     ` Alex
2019-03-21 18:31                       ` Eli Zaretskii
2019-03-21 17:38                     ` Clément Pit-Claudel
2019-03-21 18:33                       ` Eli Zaretskii
2019-03-21 17:40               ` Clément Pit-Claudel
2019-03-20 19:37   ` Clément Pit-Claudel
2019-03-21 15:24   ` Dmitry Gutov
2019-03-21 16:02     ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAP_d_8VJLwf007pzz1sCH_Vzc2y6YnOueafNCaKf2RLkQSMEKg@mail.gmail.com \
    --to=yurivkhan@gmail.com \
    --cc=cpitclaudel@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=slippycheeze@google.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).