PySimpleGUI / PySimpleGUI

Python GUIs for Humans! PySimpleGUI is the top-rated Python application development environment. Launched in 2018 and actively developed, maintained, and supported in 2024. Transforms tkinter, Qt, WxPython, and Remi into a simple, intuitive, and fun experience for both hobbyists and expert users.

Home Page:https://www.PySimpleGUI.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Question] How to change global default font size?

macdeport opened this issue · comments

Type of Issue (Enhancement, Error, Bug, Question)

Question


Environment

Operating System

Mac version ('10.10.5', ('', '', ''), 'x86_64')

PySimpleGUI Port (tkinter, Qt, Wx, Web)

tkinter


Versions

Python version (sg.sys.version)

3.9.12 (main, Mar 25 2022, 00:55:04)
[Clang 7.0.2 (clang-700.1.81)]

PySimpleGUI Version (sg.__version__)

4.60.0.1

GUI Version (tkinter (sg.tclversion_detailed), PySide2, WxPython, Remi)

8.6.12


Your Experience In Months or Years (optional)

15 Years Python programming experience
20 Years Programming experience overall
Yes Have used another Python GUI Framework? (tkinter, Qt, etc) (yes/no is fine)


Troubleshooting

These items may solve your problem. Please check those you've done by changing - [ ] to - [X]

  • Searched main docs for your problem www.PySimpleGUI.org
  • Looked for Demo Programs that are similar to your goal Demos.PySimpleGUI.org
  • If not tkinter - looked for Demo Programs for specific port
  • For non tkinter - Looked at readme for your specific port if not PySimpleGUI (Qt, WX, Remi)
  • Run your program outside of your debugger (from a command line)
  • Searched through Issues (open and closed) to see if already reported Issues.PySimpleGUI.org
  • Tried using the PySimpleGUI.py file on GitHub. Your problem may have already been fixed but not released

Detailed Description

How to change global default font size?

floating-screenshot-082842

Code To Duplicate

# Paste your code here

Screenshot, Sketch, or Drawing

Set the option font when call function `set_options'.

Refer Application-wide Configuration / Settings (set_options, etc)

import PySimpleGUI as sg

font = ("Helvetica", 16)
sg.set_options(font=font)

and when the nice psghelp is used from console? => Enhancement: such option can be store in PSG Global Setting

4.53.0 PySimpleGUI 24-Oct-2021

  • Added Commands that you can type or make shortcuts to
    • psgmain - Runs the sg.main() test harness. Your gateway to settings, version info, etc
    • psgupgrade - Upgrades PySimpleGUI to the latest version on GitHub
    • psghelp - view the SDK help window
    • psgver - view the version numbers
    • psgsettings - access the settings window (usually done via the main window)
    • Don't forget to use sudo if you're upgrading on Linux!

Enhancement: such option can be store in PSG Global Setting

Maybe lot of options can be stored in PSG Global Setting.
IMO, would like to show all the settings in my code or in my configuration file, not in a hidden place or hidden file, or may forget what's wrong and why it was in the code after long time passed.

Maybe you can try this

PyHelper 20210125.pyw
image

#5463 (comment)
Maybe I was not clear enough in my 2nd question...
When you want to run in the terminal the psghelp script (or other psg...) how to choose your own default font size apart from writing your own script ?

#5463 (comment)
Seems (and sure it is) superb but as Mac user I get this error

  File "/Users/xxx/Documents/Logiciels/Developpement/tkinter/pysimplegui/psg-helper-jason.pyw", line 292, in <module>
    ctypes.windll.user32.SetProcessDPIAware()   # Set unit of GUI to pixels
AttributeError: module 'ctypes' has no attribute 'windll'

Seems (and sure it is) superb but as Mac user I get this error

Oh, I designed it for Windows, and revised now, but not sure anything wrong if run under Linux or MacOS.

When you want to run in the terminal the psghelp script (or other psg...) how to choose your own default font size apart from writing your own script ?

Not good in English to understand what you mean.

You have to change the font settings in layout of function main_sdk_help in source code (PySimpleGUI.py) if you mean to change to font of psghelp. All the fonts defined in the source code and not use the default font, the same in my PyHelper 20210125.pyw.

This is the best place for documentation about calls.......

https://pysimplegui.readthedocs.io/en/latest/call%20reference/

If you're wanting a "terminal" experience, then you can use the Python help system. That is all the SDK help window is using as well. It simply prints to the window instead of the terminal.

image

When you want to run in the terminal the psghelp script (or other psg...) how to choose your own default font size apart from writing your own script ?

PySimpleGUI is a package. It is meant to be used by programmers. You are expected to write code, even if you've only been learning Python for 2 weeks, you're still excepted to write code.

Generally speaking, if it's impossible for you to do something from your user code, then that's something that's appropriate for an enhancement request. I'm interested in enabling new features so operations that are impossible to accomplish tend to get a higher priority when I'm considering what to implement.