parameters: (root)
docstring: Scale fonts on HiDPI displays.
docstring_summary: Scale fonts on HiDPI displays.
docstring_tokens: Scale fonts on HiDPI displays .
function: def fix_scaling(root):
      """Scale fonts on HiDPI displays."""
      import tkinter.font
      scaling = float(root.tk.call('tk', 'scaling'))
      if scaling > 1.4:
          for name in tkinter.font.names(root):
              font = tkinter.font.Font(root=root, name=name, exists=True)
              size = int(font['size'])
              if size < 0:
                  font['size'] = round(-0.75*size)
function_tokens: def fix_scaling ( root ) : import tkinter . font scaling = float ( root . tk . call ( 'tk' , 'scaling' ) ) if scaling > 1.4 : for name in tkinter . font . names ( root ) : font = tkinter . font . Font ( root = root , name = name , exists = True ) size = int ( font [ 'size' ] ) if size < 0 : font [ 'size' ] = round ( - 0.75 * size )