Gambas Documentation - /comp/gb.qt4/font

# Font (gb.qt4)

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

This class is
Creates a new font object from a font description.
creatable
.
This class acts like a
Creates a new font object from a font description and returns it.
read-only
static array.

Properties | Methods
--- | ---

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

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

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"]