From: Vincent Bernat <bernat@luffy.cx>
To: David Kastrup <dak@gnu.org>
Cc: asjo@koldfront.dk (Adam Sjøgren), emacs-devel@gnu.org, ding@gnus.org
Subject: Re: Scaling stuff for high dpi screens
Date: Fri, 30 Jan 2015 16:19:43 +0100 [thread overview]
Message-ID: <877fw4b8j4.fsf@zoro.exoscale.ch> (raw)
In-Reply-To: <87egqcbn24.fsf@fencepost.gnu.org> (David Kastrup's message of "Fri, 30 Jan 2015 11:05:55 +0100")
❦ 30 janvier 2015 11:05 +0100, David Kastrup <dak@gnu.org> :
>>> (/ (display-pixel-width) (/ (display-mm-width) 25.4))
[...]
>> I don't understand c) either, but it is quite annoying, because I can't
>> find a suitable way/hook in which to call display-pixel/mm-width at a
>> time where they give the results I expect.
For some reason, I didn't get the original message and I don't have the
whole thread either. Sorry if it has already been told.
If you use GTK as a toolkit for your Emacs, DPI changes are
automatically handled. I was previously using Lucid and switched to GTK
for this reason. This works automatically in Gnome or likewise
environments.
If you have a more "basic" environment, you need something like
xsettingsd with the target DPI*1024:
Xft/DPI 98304
I generate one with this snippet:
#+BEGIN_SRC sh
sed +Xft/DPI+d ~/.xsettingsd
dpi=$(xdpyinfo | awk '$1 ~ /resolution:/ { print $2 }' | sed 's/x.*//')
echo Xft/DPI $(( $dpi * 1024 )) >> ~/.xsettingsd
pid=$(xprop -name xsettingsd _NET_WM_PID 2> /dev/null | awk '{print $NF}')
if [ x"$pid" = x ]; then
xsettingsd -c ~/.xsettingsd &
else
kill -HUP $pid
fi
# Also use xrdb for very old stuff (you know, LibreOffice)
echo Xft.dpi: $dpi | xrdb -merge
#+END_SRC sh
However, note that the GTK version of Emacs can kill itself if a display
becomes unavailable because of some limitation of GTK.
--
Use library functions.
- The Elements of Programming Style (Kernighan & Plauger)
next prev parent reply other threads:[~2015-01-30 15:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87vbu5m25o.fsf@topper.koldfront.dk>
[not found] ` <b4ma9bfzbny.fsf@jpl.org>
[not found] ` <871twqefd6.fsf@topper.koldfront.dk>
[not found] ` <87lhulyz7g.fsf@topper.koldfront.dk>
2015-01-28 6:23 ` Scaling stuff for high dpi screens Lars Ingebrigtsen
2015-01-28 8:46 ` David Kastrup
2015-01-29 1:02 ` Lars Ingebrigtsen
2015-01-29 22:26 ` Adam Sjøgren
2015-01-29 23:57 ` Adam Sjøgren
2015-01-30 6:26 ` Eli Zaretskii
2015-01-30 10:05 ` David Kastrup
2015-01-30 15:19 ` Vincent Bernat [this message]
2015-01-30 23:38 ` Adam Sjøgren
2015-01-31 15:59 ` Vincent Bernat
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=877fw4b8j4.fsf@zoro.exoscale.ch \
--to=bernat@luffy.cx \
--cc=asjo@koldfront.dk \
--cc=dak@gnu.org \
--cc=ding@gnus.org \
--cc=emacs-devel@gnu.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.