MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / fix_scaling

Function fix_scaling

tools/python-3.11.9-amd64/Lib/idlelib/run.py:321–330  ·  view source on GitHub ↗

Scale fonts on HiDPI displays.

(root)

Source from the content-addressed store, hash-verified

319
320
321def fix_scaling(root):
322 """Scale fonts on HiDPI displays."""
323 import tkinter.font
324 scaling = float(root.tk.call('tk', 'scaling'))
325 if scaling > 1.4:
326 for name in tkinter.font.names(root):
327 font = tkinter.font.Font(root=root, name=name, exists=True)
328 size = int(font['size'])
329 if size < 0:
330 font['size'] = round(-0.75*size)
331
332
333def fixdoc(fun, text):

Callers 4

mainFunction · 0.90
_testFunction · 0.90
setUpClassMethod · 0.90
show_socket_errorFunction · 0.85

Calls 2

callMethod · 0.80
namesMethod · 0.45

Tested by 1

setUpClassMethod · 0.72