MCPcopy Index your code
hub / github.com/python/cpython / fix_scaling

Function fix_scaling

Lib/idlelib/run.py:329–338  ·  view source on GitHub ↗

Scale fonts on HiDPI displays.

(root)

Source from the content-addressed store, hash-verified

327
328
329def fix_scaling(root):
330 """Scale fonts on HiDPI displays."""
331 import tkinter.font
332 scaling = float(root.tk.call('tk', 'scaling'))
333 if scaling > 1.4:
334 for name in tkinter.font.names(root):
335 font = tkinter.font.Font(root=root, name=name, exists=True)
336 size = int(font['size'])
337 if size < 0:
338 font['size'] = round(-0.75*size)
339
340
341def fixdoc(fun, text):

Callers 4

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

Calls 2

callMethod · 0.45
namesMethod · 0.45

Tested by 1

setUpClassMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…