From e6cf81175e40bf4b88480dd81a9a666ece699bf0 Mon Sep 17 00:00:00 2001 From: kokikapoor <67024719+kokikapoor@users.noreply.github.com> Date: Fri, 6 Nov 2020 02:08:32 -0500 Subject: [PATCH 1/2] Set a Default Font for Tkinter GUI These are the instructions on how to set a default font for your GUI... hope you find it useful! --- suggestions.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/suggestions.md b/suggestions.md index ed7b9f9..3c04e6e 100644 --- a/suggestions.md +++ b/suggestions.md @@ -3,3 +3,18 @@ You could use a recursive 2d depth first search algorithm! Check out [this site](https://www.hackerearth.com/practice/algorithms/graphs/depth-first-search/tutorial/) for more info. If the runtime for checking each word against the dictionary using the Merriam Webster API turns out to be too long, you can use a prefix tree to search. This is a much faster solution, but would take a little longer to implement if you haven't seen it before. +> How to set a default font for the Tkinter Graphic User Interface (GUI) +1) You can use one of the built in Tkinter fonts such as TkDefaultFont, TkTextFont, TkFixedFont. +2) Get a handle of the font and then use the ```python configure ``` method to alter the size of the font as shown below +```python +default_font = tkFont.nametofont("TkDefaultFont") +default_font.configure(size=48) +``` +3) To add this default font to all your widgets, use +```python +root.option_add("*Font", default_font) +``` +NOTE: For ```python option_add``` to be present in all files, classes, and widgets, you must only implement it BEFORE creating widgets + +Sources/Citations: +https://stackoverflow.com/questions/15462647/modify-the-default-font-in-python-tkinter From f3be744242fbd83e3c54e8cd4506a13688624768 Mon Sep 17 00:00:00 2001 From: Kohana Kapoor Date: Fri, 13 Nov 2020 01:43:03 -0500 Subject: [PATCH 2/2] Default Font --- suggestions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/suggestions.md b/suggestions.md index 3c04e6e..2e68d13 100644 --- a/suggestions.md +++ b/suggestions.md @@ -3,7 +3,7 @@ You could use a recursive 2d depth first search algorithm! Check out [this site](https://www.hackerearth.com/practice/algorithms/graphs/depth-first-search/tutorial/) for more info. If the runtime for checking each word against the dictionary using the Merriam Webster API turns out to be too long, you can use a prefix tree to search. This is a much faster solution, but would take a little longer to implement if you haven't seen it before. -> How to set a default font for the Tkinter Graphic User Interface (GUI) +> How to set a default font for the Tkinter Graphic User Interface (GUI) etc. 1) You can use one of the built in Tkinter fonts such as TkDefaultFont, TkTextFont, TkFixedFont. 2) Get a handle of the font and then use the ```python configure ``` method to alter the size of the font as shown below ```python