[issue31500] IDLE: Tiny font on HiDPI display

Terry J. Reedy report at bugs.python.org
Mon Sep 18 14:23:36 EDT 2017


Terry J. Reedy added the comment:

Thank you Cheryl.  That is enough to reject the patch is it is now.

The negative sizes are pixels.  I think it might be better to multiply them by a systems specific factor, but only when needed.

One might wish that the scaling should be handled automatically, in tkinter if not in tk itself.  But it was mentioned in one of the links that displays do not always report their dpi correctly.

One possibility is a tkinter calibration app that displays a 500 or 1000 pixel line (user selects) and asks the user to input the physical length (centimeters or inches).  (Some games do something similar with brightness.)

To check whether a tkinter scaling app could be used, I sized Serhiy's image so that the sample font in the Settings Font tab matched the sample font in a real box.  The system font around it is tiny but readable, especially with a magnifier.

This is a tkinter issue, not only an IDLE issue, but IDLE is a good test app, with realistically complex dialogs. Lacking a Python-wide fix, something could be added to the Font tab -- for instance a dpi multiplier that defaults to one.  It would only be used if not 1.0.

I reread config.IdleConf.GetFont.  Rather than manipulate one of tk's default fonts ('TkFixedFont'), it creates a normal font sized in points.  It uses 'TkFixedFont' as a handy key for finding a system-specific sure-to-exist fixed pitch font: "actualFont = Font.actual(f)", where f is a TkFixedFont instance.  Thus it does not affect the dialogs.

It would be helpful to know if HiDPI screens on Windows have a problem.

#31496 is about test_configdialog failing on the same HiDPI screen.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31500>
_______________________________________


More information about the Python-bugs-list mailing list