From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vincent Bernat Newsgroups: gmane.emacs.gnus.general,gmane.emacs.devel Subject: Re: Scaling stuff for high dpi screens Date: Fri, 30 Jan 2015 16:19:43 +0100 Message-ID: <877fw4b8j4.fsf@zoro.exoscale.ch> References: <87vbu5m25o.fsf@topper.koldfront.dk> <871twqefd6.fsf@topper.koldfront.dk> <87lhulyz7g.fsf@topper.koldfront.dk> <8761brwhiz.fsf@building.gnus.org> <878ugncmwv.fsf@fencepost.gnu.org> <87siet3ztx.fsf@topper.koldfront.dk> <87egqcbn24.fsf@fencepost.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1422631247 25912 80.91.229.3 (30 Jan 2015 15:20:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 30 Jan 2015 15:20:47 +0000 (UTC) Cc: asjo@koldfront.dk (Adam =?utf-8?Q?Sj=C3=B8gren?=), emacs-devel@gnu.org, ding@gnus.org To: David Kastrup Original-X-From: ding-owner+M33916@lists.math.uh.edu Fri Jan 30 16:20:44 2015 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YHDNE-0006sk-51 for ding-account@gmane.org; Fri, 30 Jan 2015 16:20:44 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1YHDMR-0008K9-2k; Fri, 30 Jan 2015 09:19:55 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1YHDMP-0008Jx-Bk for ding@lists.math.uh.edu; Fri, 30 Jan 2015 09:19:53 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.84) (envelope-from ) id 1YHDMN-0005bs-Mr for ding@lists.math.uh.edu; Fri, 30 Jan 2015 09:19:52 -0600 Original-Received: from bart.luffy.cx ([78.47.78.131]) by quimby.gnus.org with esmtp (Exim 4.80) (envelope-from ) id 1YHDMI-0004uF-Fu for ding@gnus.org; Fri, 30 Jan 2015 16:19:48 +0100 Original-Received: from bart.luffy.cx (localhost [127.0.0.1]) by bart.luffy.cx (Postfix) with ESMTP id 0019314423; Fri, 30 Jan 2015 16:19:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=simple; d=luffy.cx; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=postfix; bh=h8RlNDNZm 9SEuRf/9+87lmFnk54=; b=V7CMbB2kBKFE9jW9aUqud0lC1iNGPJLHjeJmHSHYL nIlC4+zBZIf8hNtkL8TdD8cjGMQtCl9XE4OjA6Bmn7Ga+tN4BcVjfsF/eyMrwH0E 0lkwJQ2HnUUJ1v+2uQ/7ext43Ll9Q4meS6EsV6SKBXeK4lOvgY/3H2IjZI4M5YNK 5w= DomainKey-Signature: a=rsa-sha1; c=simple; d=luffy.cx; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=postfix; b=b18 VE/a2gp4CzVFr3wLe0IjTOUOMCbiYnl8MGA9F8rr6pTP23Tu6S+/1Ix0NHtVRRsk 5i7ppAQrB79g5/TUTKDnJa8MGX0QCUe/w1byxmazaUuH56HTLjr5S4JUsrcFEKSo lq42ZoTalL5RgFKLZnXxiHW1WXXFgCVmrn7v8Od4= Original-Received: from zoro.exoscale.ch (unknown [194.88.192.200]) by bart.luffy.cx (Postfix) with ESMTPS id B5A33141AC; Fri, 30 Jan 2015 16:19:44 +0100 (CET) Original-Received: by zoro.exoscale.ch (Postfix, from userid 1000) id E9B2E275; Fri, 30 Jan 2015 16:19:43 +0100 (CET) In-Reply-To: <87egqcbn24.fsf@fencepost.gnu.org> (David Kastrup's message of "Fri, 30 Jan 2015 11:05:55 +0100") User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4 (gnu/linux) X-Spam-Score: -2.0 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:85677 gmane.emacs.devel:182059 Archived-At: =E2=9D=A6 30 janvier 2015 11:05 +0100, David Kastrup =C2=A0: >>> (/ (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=3D$(xdpyinfo | awk '$1 ~ /resolution:/ { print $2 }' | sed 's/x.*//') echo Xft/DPI $(( $dpi * 1024 )) >> ~/.xsettingsd pid=3D$(xprop -name xsettingsd _NET_WM_PID 2> /dev/null | awk '{print $NF}') if [ x"$pid" =3D 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. --=20 Use library functions. - The Elements of Programming Style (Kernighan & Plauger)