Python Gui-tkinter Fonts: The first element as a tuple is the font family, the size of a point, optionally a string that contains one or more bold, italic, underlined style modifiers, bold.there can be up to three ways to specify a type style.Simple tuple font:
As the first element of a tuple is the font family, the size of a point, you can choose a string that contains one or more bold, italic, underlined style modifiers, bold.
Example:
("Helvetica", "+") for a 16-point Helvetica regular.
("Times", "$", "bold Italic") for a 24-point times bold italic.
Font Object fonts:
You can create a Font object. By importing the Tkfont module and using the construction of its font class:
Import Tkfontfont = tkfont.font (option, ...)
Here is a list of options:
Family: The font family name as a string.
Size: The height of the font as an integer to point. To get the n pixels of a font high, use-N.
Weight: ' bold ' for boldface, ' normal ' for regular weight.
Slant: "Italic" for Italic, "Roman" for unslanted.
Underline:1 for underlined text, 0 for normal.
Overstrike:1 for Overstruck text, 0 for normal.
Example:
helv36 = Tkfont.font (family= "Helvetica", size=36,weight= "bold")
X Window Font:
If you are running the X Window System, you can use any of the X font names.
For example, the name "font-r-* in *-lucidatypewriter-*-*-140-*-*-* *-*-*-*" is the author's favorite fixed-width screen used on the font. Use the Xfontsel program to help you choose beautiful fonts.
Tkinter Fonts (font)