Scale fonts on HiDPI displays.
(root)
| 319 | |
| 320 | |
| 321 | def 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 | |
| 333 | def fixdoc(fun, text): |