Font Class

The Font class is used to change the font of other objects that display text.

When creating a font object, you specify the font family name, font size, and optional font style parameters.  Different styles may be combined when creating a font using the bitwise OR operator. For example, use the code below to create a bold and italicized 10 point Arial font and assign it to the Font property of a TextLabel drawing object and a Label control in a form.

myFont = Font.Create("Arial", 10, FontStyle.Bold OR FontStle.Italic);

myTextLabel.Font = myFont;

myLabel.Font = myFont;

It is important to note that Font class properties are read-only and are used to access previously set font parameters. The parameters are set, as shown above, using the Font.Create method.

Namespace: elsystem.drawing

Properties

   Additional properties, methods, and events are described in the classes listed under Inheritance Hierarchy (see below).

  Name Type Description
Public property Bold bool True when the text using this Font is set to display in bold.
Public property Italic bool True when the text using this Font is set to display in italic.
Public property Name string Gets the name of the font family to be displayed.
Public property Size double Gets the size of the font to be displayed in points.
Public property Strikeout bool True when the text using this Font is set to display with a strikeout
Public property Style enum Gets the FontStyle of the Font.
Public property Underline bool True when the text using Font is set to display as underlined.
Public property Unit enum Gets the unit of measure of the Font. See GraphicsUnit for possible values.
Methods
  Name Description
Public property Create( FontName, Size) Creates a font object using a specified font name string and font size value (float).
Public property Create( FontName, Size, FontStyle) Creates a font object using a specified font name string, font size value (float), and font style parameters. See FontStyle for a list of possible values.
Public property Create( FontName, Size, FontStyle, Unit) Creates a font object using a specified font name string, font size value (float), font style parameters, and graphics unit parameter. See FontStyle and GraphicsUnit for a list of possible values.