4

How can you change the font settings for the input boxes and message text in EasyGUI? I know you have to edit a file somewhere, but that's about it. Exactly how to do it and what to edit would be appreciated.

Thanks in advance.

Aristides
  • 3,805
  • 7
  • 34
  • 41

2 Answers2

5

Go to your python folder\Lib\site-packages\easygui and then open the easygui.py file in your text editor. If you scroll through that file it's very close to the top. You should see this in the code and you can just change it accordingly.

PROPORTIONAL_FONT_FAMILY = ("MS", "Sans", "Serif")
MONOSPACE_FONT_FAMILY    = ("Courier")

PROPORTIONAL_FONT_SIZE  = 10
MONOSPACE_FONT_SIZE     =  9 
TEXT_ENTRY_FONT_SIZE    = 12  
Benjooster
  • 544
  • 2
  • 6
  • 20
  • 1
    thank you. how exactly would i be able to change it? say, if i wanted the font to be verdana; would it simply be PROPORTIONAL_FONT_FAMILY = ("Verdana") ? Just wondering as it is a tuple, not a single string with spaces – Aristides Aug 07 '13 at 15:21
  • You're actually going to want to change the `PROPORTIONAL_FONT_FAMILY` not the monospace if you're trying to change the appearance of your GUI. The only place I see the `MONOSPACE` being used is in the `codebox` module. The tuple is not a requirement. You could type either `"Segoe Print"` or `"Segoe", "Print"` and would get the same result. I would however mimic the orginal code as much as possible in that instance. – Benjooster Aug 07 '13 at 16:47
  • Okay. I was just wondering why the proportional font family was ("MS", "Sans", "Serif") instead of simply ("MS Sans Serif") – Aristides Aug 08 '13 at 12:15
  • I honestly don't have an answer. In the changes log for one of the final updates that easygui received it says that changes were made to make changing fonts easier so it's possible that was one of them and he didn't bother to change the code. It works either way. – Benjooster Aug 08 '13 at 16:05
3

In addition to what @Benjooster answered previously: Apparently sometimes the font settings are not in easygui.py, but rather in Python27\Lib\site-packages\easygui\boxes\state.py

TVogt
  • 185
  • 1
  • 1
  • 11