On Sun, 4 Oct 2020 20:03:53 +0200 Vadim Zeitlin wrote:
VZ> On Sun, 4 Oct 2020 10:11:25 -0700 (PDT) Iwbnwif Yiw wrote:
VZ>
VZ> IY> Unfortunately, it appears that the pixel sized fonts are also scaled with a
VZ> IY> font at 200% appearing twice the size as one at 100%
VZ>
VZ> IMO this is a bug :-(
Wait, I can't agree with myself. On one hand, we don't multiply pixels by
the scaling factor elsewhere under MSW. But OTOH we don't have anything
like FromDIP() for fonts, i.e. if you really want the current behaviour,
there would be no way to achieve it if this bug was fixed.
And you probably do want all the fonts to be scaled automatically,
irrespectively of how they were created. I.e. even if you create a font by
specifying its height in pixels, you'd presumably want it to scale up when
the window using this font is moved to a high DPI display, wouldn't you?
And, again, if this didn't happen by default, there would be no way to make
it happen with the current API.
So I think that finally I've convinced myself that the current behaviour
is correct, or at least better than the alternative. Returning back to your
original question, I think you need to scale the coordinates of the
elements of your window that grow with fonts. I.e. you can use the rest of
the coordinates without scaling, to avoid blurriness, but some of them do
need to be scaled by GetContentScaleFactor().
Sorry for the confusion,