Search Framework:
WLFont
Namespace: WealthLab.Core
Parent: Object

The WLFont class represents a font in a platform-independent way. It stores the font family name, size, and bold and italic attributes used by WealthLab for chart labels and other visual elements.

Constructors
WLFont
public WLFont()
public WLFont(
string fontName,
int fontSize = 8,
bool isBold = false,
bool isItalic = false)

The parameterless constructor creates a WLFont using the default property values:

FontName = "Arial"
FontSize = 8
IsBold = false
IsItalic = false

The second constructor creates a WLFont using the specified font family and optional size, bold, and italic settings. For example:

WLFont font = new WLFont("Arial", 10, true);

creates a 10-point bold Arial font.



Members
FontName
public string FontName

Gets or sets the font family name. The default value is "Arial". For example:

font.FontName = "Tahoma";

FontSize
public int FontSize

Gets or sets the font size. The default value is 8.


IsBold
public bool IsBold

Gets or sets whether the font should be rendered using bold text. The default value is false.


IsItalic
public bool IsItalic

Gets or sets whether the font should be rendered using italic text. The default value is false.


Parse
public static WLFont Parse(string s)

Creates a WLFont by parsing a string previously generated by ToString. The string must contain exactly four comma-separated values:

FontName,FontSize,IsBold,IsItalic

For example:

WLFont font = WLFont.Parse("Tahoma,12,True,False");

If the string does not contain exactly four values, an ArgumentException is thrown.


ToString
public override string ToString()

Returns a string representation of the WLFont containing its font name, size, bold setting, and italic setting. The format is:

FontName,FontSize,IsBold,IsItalic

For example:

Arial,10,True,False

The resulting string can be converted back into a WLFont using Parse.



Static Members
Standard
public static WLFont Standard

Contains the standard font used by WealthLab for Strategy plotting. The initial value is a default WLFont:

new WLFont()

which represents 8-point Arial with bold and italic disabled.