Tkinter Fonts (font)

Source: Internet
Author: User
Tags modifiers

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.