Scale fonts on HiDPI displays.
(root)
| 327 | |
| 328 | |
| 329 | def 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 | |
| 341 | def fixdoc(fun, text): |
searching dependent graphs…