class Font

A Font object represents a set of characters of a particular typeface, style and size. Font objects are immutable.

Constructor

Font(family, style, size)
The family is the name of a font family ("Times", "Helvetica", etc...) The style is a list of zero or more of: 'bold', 'italic'. The size is measured in points.

Properties

family
Read-only. Family name of the font.

style
Read-only. Style of the font.

size
Read-only. Point size of the font.

ascent
Read-only. Distance from the baseline of the font to the top of the tallest character.

descent
Read-only. Distance from the baseline of the font to the bottom of the lowest character.

height
Read-only. Height of the font (equal to the ascent plus the descent).

 Methods

width(string [,start [,end]])
Returns the width of the specified part of the given string when drawn in this font.

Constants

system_font
application_font
Predefined Font instances representing the standard fonts for system text and application text, respectively.