Font (gb.qt4)

This class represents a font used for drawing or displaying text in controls.

This class is creatable.

This class acts like a read-only static array.

Properties
Ascent   Returns the ascent of the font.
Bold   Indicates if a font is bold.
Descent   Returns the descent of the font.
Fixed   Returns if a font is fixed, i.e. if all its characters have the same width.
Grade   Returns or sets the relative size of the font.
H   A synonymous for the Height property.
Height   Returns the height in pixels of a text displayed with the font.
Italic   Indicates if a font is italic.
Modified   Return or set if a font has been modified.
Name   Returns or sets the name of the font.
Scalable   Returns if a font is scalable.
Size   Returns or sets the size of the font.
Strikeout   Indicates if a font is strikeout.
Styles   Returns all styles supported by the font.
Underline   Indicates if a font is underlined.

Methods
Copy   Return a copy of the font object.
RichTextHeight   Return the height of a rich text fragment.
RichTextSize   Return the size of a rich text fragment.
RichTextWidth   Return the width of a rich text fragment.
TextHeight   Return the height of a text string.
TextSize   Return the size of a text string.
TextWidth   Return the width of a text string.
ToString   Returns the full name of a font as a description string.

The font object from the Control.Font property keeps a link to the control it comes from, so that modifying this font object modifies the font used for drawing the control.

Examples

' Set the font used by MyTextBox for displaying its text
MyTextBox.Font.Name = "Utopia"

' Set the font used by MyTextBox for displaying its text from a string containing the font values
MyTextBox.Font = Font["Arial,12,Bold"]