
#FONT NAMES AND STYLES FULL#
System fonts are full font names, not family names, and they cannot be combined with size or style attributes. On the Macintosh, the system font names are application and system.Under Windows, these include ansi, ansifixed, device, oemfixed, system, and systemfixed.Tk also supports system specific font names.If 1 (true), a line is drawn over text written with this font. To give the size in pixels, use a negative value.įont thickness. The Font constructor supports the following style options (note that the constants are defined in the tkFont module): Font Styleįont size in points. If you modify a named font using the config method, the changes are automatically propagated to all widgets using the font. TkFont.Font(family="Helvetica", size=12, weight=tkFont.BOLD, tkFont.Font(family="Times", size=12, weight=tkFont.BOLD) Such instance can be used everywhere for Tkinter accepts a font specifier.įont instance is also used to get font metrics, including the size occupied by a given string written in that font. The tkFont module provides a Font class which allows you to create font instances. Tk 8.0 automatically maps Courier, Helvetica, and Times to their corresponding native family names on all platforms. The available styles are normal, bold, roman, italic, underline, and overstrike.
#FONT NAMES AND STYLES WINDOWS#
Here are some families available on most Windows platforms:Īrial (corresponds to Helvetica), Courier New (Courier), Comic Sans MS, Fixedsys, MS Sans Serif, MS Serif, Symbol, System, Times New Roman (Times), and Verdana. If the family name doesn’t include spaces, you can also add size and styles to the string itself: "Times 12 bold" To get the default size and style, you can give the font name as a single string. Tkinter supports platform independent font descriptors.Ī font can be specified as tuple containing a family name, a height in points, and optionally a string with one or more styles. Tkinter supports a number of different font descriptor types: Fonts Names, Font Descriptors, System Fonts, Text formatting, Borders, Relief Styles in Pythonįonts Names, Font Descriptors, System Fonts, Text formatting, Borders, Relief Styles in PythonĪll widgets provide reasonable default values.įonts are usually specified using the font widget option.
