EasyLanguage Object Reference

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

[ Expand All ]
Properties
  Name Type Description
Public property Bold boolean True when the font is set to display in bold.
Public property Italic boolean True when the 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 Underline boolean True when the font is set to display as underlined.

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

Methods
  Name Description
Public property Create( string, int ) Creates a font object using a specified font name string and size value.
Public property Create( string, int, FontStyle) Creates a font object using a specified font name string, size value, and font style parameters. See FontStyle for a list of possible values.
Public property Create( string, int, FontStyle, bool, bool) Creates a font object using a specified font name string, size value, and font style parameters. The booleans are True for underline and strike-through, respectively. See FontStyle for a list of possible values.
Inheritance Hierarchy

elsystem.Object

  elsystem.DotNetObject

    elsystem.drawing.Font