From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: display-mm-width return value off on Windows Date: Fri, 07 Jul 2006 00:08:59 +0300 Message-ID: References: Reply-To: Eli Zaretskii NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1152220159 4760 80.91.229.2 (6 Jul 2006 21:09:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 6 Jul 2006 21:09:19 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 06 23:09:18 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 1Fyb64-0003nN-0X for ged-emacs-devel@m.gmane.org; Thu, 06 Jul 2006 23:09:16 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fyb63-00026N-Ek for ged-emacs-devel@m.gmane.org; Thu, 06 Jul 2006 17:09:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fyb5r-00025s-Lb for emacs-devel@gnu.org; Thu, 06 Jul 2006 17:09:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fyb5q-00025E-O9 for emacs-devel@gnu.org; Thu, 06 Jul 2006 17:09:03 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fyb5q-000258-E5 for emacs-devel@gnu.org; Thu, 06 Jul 2006 17:09:02 -0400 Original-Received: from [192.114.186.66] (helo=romy.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Fyb66-0005LM-UQ for emacs-devel@gnu.org; Thu, 06 Jul 2006 17:09:19 -0400 Original-Received: from HOME-C4E4A596F7 (IGLD-83-130-192-59.inter.net.il [83.130.192.59]) by romy.inter.net.il (MOS 3.7.3-GA) with ESMTP id FDC00296 (AUTH halo1); Fri, 7 Jul 2006 00:08:59 +0300 (IDT) Original-To: Ralf Angeli In-reply-to: (message from Ralf Angeli on Thu, 06 Jul 2006 19:50:26 +0200) 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:56658 Archived-At: > 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.