There's more than one way to do things | |
PerlMonks |
Re: Tk screen and monitor size in mm, DPI and scalingby kcott (Archbishop) |
on Mar 13, 2021 at 05:55 UTC ( [id://11129559]=note: print w/replies, xml ) | Need Help?? |
G'day Discipulus, I don't believe I've ever used either of those mm methods; and I don't think I've used mm sizes for specifying widths, padding, etc. Except for character sizes for a few text-based widgets, I always gone with pixels. Anyway, I was curious and do seem to have a similar issue to what you describe. Here's the output from the test code you posted:
I have Perl 5.32 and Tk 804.035 running on a Cygwin/Win10 OS. The system (Win10 Settings) reports 2560x1440; I'm pretty sure that's accurate. The manufacturer's spec gives the monitor width as 27" — I wonder if that's the physical size (i.e. includes the housing surrounding the useable/viewable part of the screen). Those numbers would give me a DPI of 94.8148148148148 (2560/27); and, factoring in the scaling, a point size of 1/71.0761154855644" (not the expected 1/72"). I don't know how the mm sizes are determined. I had a look in https://github.com/eserte/perl-tk/blob/master/Tk/Widget.pm but couldn't see anything useful there; it's probably hidden away in XS code somewhere. I also had a look in "Active bugs for Tk". I didn't see anything relevant but, with 140 outstanding issues, it's not impossible that I missed something. It may be worth raising a bug report. I don't use PowerShell but I do have it available. I tried your Get-WmiObject command, both as a normal user and as Administrator, and got the same error:
I, too, was a little surprised at the scaling value. The system (Win10 Settings) reports scaling of 100%; not 133.398982438864%. — Ken
In Section
Seekers of Perl Wisdom
|
|