This is the mail archive of the
cygwin-apps@cygwin.com
mailing list for the Cygwin project.
RE: setup.exe: Clues about missing scroll bar in package list
- From: "Gary R. Van Sickle" <g dot r dot vansickle at worldnet dot att dot net>
- To: <cygwin-apps at cygwin dot com>
- Date: Sun, 24 Nov 2002 04:54:32 -0600
- Subject: RE: setup.exe: Clues about missing scroll bar in package list
> Hi there.
>
> I gather this list is the place to discuss problems with Cygwin's setup.exe --
> apologies if I'm wrong. I've seen some discussion about font size problems
> and losing the scroll bar in the package list window, including a request for
> debug suggestions. Since this problem affects me, I thought I'd do some
> digging. It's a few years since I've done any Windows coding and quite a few
> more since I touched C++, but I have a couple of ideas and pointers to MSDN
> references which might be useful.
>
> At a guess, window.cc (and maybe other places?) should be dividing the result
> of GetDeviceCaps(hdc, LOGPIXELSY) by 96 (the naive default value for dots per
> inch), instead of 72 (the standard-ish value of points per inch). There may
> be other similar scalings needed. See
>
> How to Write High-DPI Applications
> http://msdn.microsoft.com/library/default.asp?
> url=/library/en-us/dngdi/html/highdpiapp.asp
>
> which talks about "how much to scale a design that assumes 96-DPI pixels" and
> mentions that "Bitmapped fonts are written for 96-DPI screens, and don=92t
> scale". There may be ways to write your code to just not assume 96 DPI in the
> first place, but I don't know what that might involve.
>
It looks like that's what I'm doing there though when I pass in this as the
height to CreatFont():
-MulDiv (Pointsize, GetDeviceCaps (hdc, LOGPIXELSY), 72)
Albeit this essentially would be "how much to scale a design that assumes 72-DPI
pixels". I got this from the Platform SDK's CreateFont docs, which say:
"For the MM_TEXT mapping mode, you can use the following formula to specify a
height for a font with a specified point size:
nHeight = -MulDiv(PointSize, GetDeviceCaps(hDC, LOGPIXELSY), 72);"
--
Gary R. Van Sickle
Brewer. Patriot.