From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: display-mm-width return value off on Windows Date: Thu, 06 Jul 2006 23:25:07 +0200 Message-ID: <857j2qwhn0.fsf@lola.goethe.zz> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1152221181 8131 80.91.229.2 (6 Jul 2006 21:26:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 6 Jul 2006 21:26:21 +0000 (UTC) Cc: Ralf Angeli , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 06 23:26:17 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FybMW-00070C-S7 for ged-emacs-devel@m.gmane.org; Thu, 06 Jul 2006 23:26:17 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FybMW-0002Nl-9w for ged-emacs-devel@m.gmane.org; Thu, 06 Jul 2006 17:26:16 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FybML-0002NU-0u for emacs-devel@gnu.org; Thu, 06 Jul 2006 17:26:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FybMK-0002NH-Ka for emacs-devel@gnu.org; Thu, 06 Jul 2006 17:26:04 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FybMK-0002ND-Dx for emacs-devel@gnu.org; Thu, 06 Jul 2006 17:26:04 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FybMb-0006d3-AW for emacs-devel@gnu.org; Thu, 06 Jul 2006 17:26:21 -0400 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1FybMC-000671-MJ; Thu, 06 Jul 2006 17:25:59 -0400 Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id ACF841C3663F; Thu, 6 Jul 2006 23:25:07 +0200 (CEST) Original-To: Eli Zaretskii In-Reply-To: (Eli Zaretskii's message of "Fri, 07 Jul 2006 00:08:59 +0300") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:56662 Archived-At: Eli Zaretskii writes: >> From: Ralf Angeli >> Date: Thu, 06 Jul 2006 19:50:26 +0200 >> >> On Windows the return values of `display-mm-width' and >> `display-mm-height' don't really reflect the screen width and height >> in millimeters. I attached a patch which yields more realistic >> results. > > Thanks. > >> In my case: >> >> display-mm-* display-mm-* >> Real size without patch with patch >> Width 285mm 370 279 >> Height 215mm 277 203 >> >> For a preview-latex user who originally reported the problem: >> >> display-mm-* display-mm-* >> Real size without patch with patch >> Width 330mm 320 305 >> Height 207mm 240 203 > > That is still not a very good approximation, is it? > >> - cap = GetDeviceCaps (hdc, VERTSIZE); >> + height = round (GetDeviceCaps (hdc, VERTRES) >> + / GetDeviceCaps (hdc, LOGPIXELSY) * 25.4); > > What is this magic constant 25.4? I think we at least should use a > single macro instead of having the literal constant scattered across > the sources. Millimeters per inch. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum