Author terry.reedy
Recipients paul.moore, steve.dower, terry.reedy, tim.golden, zach.ware
Date 2018-05-26.23:14:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1527376490.94.0.682650639539.issue33656@psf.upfronthosting.co.za>
In-reply-to
Content
On IDLE-dev today, Elisha Paine, from Ranelagh School in England, wrote:
'''
I love IDLE (so simple and lightweight compared with other IDEs) and was just wondering if you could add the following code into pyshell.py (as I have done on mine) because, as you will be able to tell, it sets DPI awareness (and on my set-up makes the text a lot clearer)

import ctypes
try: ctypes.windll.shcore.SetProcessDpiAwareness (True)
except: pass
'''
On my Win 10 system with a 2560 x 1440 27" monitor, the text is noticeably sharper, some colors are brighter, and some characters are better formed.  The main effect seems to be from properly lining up vertical and horizontal lines with the pixels.  Lines that are supposed to be 1 or 2 pixels wide are just that, instead of bleeding over onto additional rows or columns.

By comparing IDLE's shell with Windows consoles with the same font and text, both for Command Prompt and Python x.y consoles, I determined that the Windows consoles have DPI awareness on.  The text is longer with it off and some character shapes, such as for 2 and 3, don't match, whereas text length and shape matches perfectly with it on.

At least some other apps also have DPO awareness on.  With the patch, the Open and Save As dialogs opened opened by from IDLE, via the tkinter/tk function, match those opened by Firefox.  Without the patch, not.

I like the improvement and with 3.7.0rc1 delayed, would like to get it in now.  My question for you Windows experts is 1. Is the above exactly the right thing? and 2. Should it be unconditional, or is there a possible downside?  Do consoles always have DPI awareness, or is it conditional on the monitor? 

I will make a PR as soon as I post this and get an issue number.
History
Date User Action Args
2018-05-26 23:14:51terry.reedysetrecipients: + terry.reedy, paul.moore, tim.golden, zach.ware, steve.dower
2018-05-26 23:14:50terry.reedysetmessageid: <1527376490.94.0.682650639539.issue33656@psf.upfronthosting.co.za>
2018-05-26 23:14:50terry.reedylinkissue33656 messages
2018-05-26 23:14:50terry.reedycreate