unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Yuan Fu <casouri@gmail.com>
To: Yuuki Harano <masm+emacs@masm11.me>
Cc: emacs-devel@gnu.org
Subject: Re: Which should the display-pixel-width function return, physical pixel width or logical pixel width?
Date: Fri, 1 Jan 2021 16:51:21 -0500	[thread overview]
Message-ID: <111C5580-03ED-496F-AEC7-D2C30E52B9E1@gmail.com> (raw)
In-Reply-To: <20210101.234418.2112625777155657071.masm@luna.pink.masm11.me>



> On Jan 1, 2021, at 9:44 AM, Yuuki Harano <masm+emacs@masm11.me> wrote:
> 
> Hi, I'm pgtk developer.
> 
> Currently, display-pixel-width of vanilla emacs returns physical pixel
> width.  i.e. it returns 3840 even if GDK_SCALE=2 when using 3840x2160.
> 
> Some emacs lisps (like preview in auctex) use display-pixel-width and
> display-mm-width to calculate physical dpi.
> 
> I think it is strange. On multi-monitor environment,
> display-pixel-width and display-mm-width contains all the monitors,
> that may be different dpi.  The result dpi is between the two.
> Those emacs lisps should use per-monitor information.
> 
> Currently, pgtk emacs returns logical pixel width, i.e. 1920, because
> Gdk returns it.  On multi-monitor environment, Gdk returns 1920 +
> something.
> 
> I'm going to add scale-factor in per-monitor information to support
> scaling.  dpi-sensitive emacs lisps can extract logical pixel width,
> mm width, and scale-factor from it, and calculate dpi.
> 
> "Monitor" is a recent concenpt.
> If pgtk emacs returns logical one, then compatibility may be broken.
> If pgtk emacs returns physical one, then those emacs lisps continue to
> do strange calculation.
> 
> What should the display-pixel-width function (and
> display-monitor-attributes-list) return, physical pixel width, logical
> pixel width, or implementation-dependent?  The documentation of
> display-pixel-width seems to say nothing about that.
> -- 
> Yuuki Harano
> 

As hidpi screens getting more common, we should separate pixel sizes reported from frontends into logical and physical pixels. This problem also makes images on Mac fuzzy. Currently ns frontend can distinct between logical and physical pixel size, from Yuuki’s post it seems pgtk can, too. Does other frontends have such ability?

Yuan




  reply	other threads:[~2021-01-01 21:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-01 14:44 Which should the display-pixel-width function return, physical pixel width or logical pixel width? Yuuki Harano
2021-01-01 21:51 ` Yuan Fu [this message]
2021-01-02  7:40   ` Yuuki Harano
2021-01-02 10:31     ` Alan Third
2021-01-02  6:04 ` Lars Ingebrigtsen
2021-01-03  8:34   ` Yuuki Harano

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=111C5580-03ED-496F-AEC7-D2C30E52B9E1@gmail.com \
    --to=casouri@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=masm+emacs@masm11.me \
    /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).