BiFont

This class is used with BiLabel to provide the font style information.

This class extends BiObject and therefore all methods and fields available for BiObject are also available for BiFont .

Constructor

new BiFont ( [ nSize [ ,sName ] ] )

Parameters

NameTypeOptionalDefaultDescripton
nSizeNumbercheckedThe font size in pixels
sNameStringcheckedThe font name

Properties

NameTypegetsetDescripton
boldBooleancheckedcheckedWhether to use bold
italicBooleancheckedcheckedWhether to use italic
nameStringcheckedcheckedThe name of the font. A comma separated list also works
sizeNumbercheckedcheckedThe font size (in pixels)
strikeoutBooleancheckedcheckedWhether to line through the text
underlineBooleancheckedcheckedWhether to underline the text

Methods

NameDescription
paintFontApplies the font described by the current font object to the component.
removeFontRemoves this font from a component. The font styles that this font object has applied to a component will be reset/removed.

Events

None.

Static Methods

NameDescription
fromStringParses a string and returns a new font object. The format for the string is

"bold"? "italic"? "underline"? "strikeout"? (<size>"px"?)? <font name>?

12px bold italic Arial

The order of the parts is not relevant.

Static Fields

None.

Remarks

To change the font of the component you have to use setFont(). Changing the font object without calling setFont() will not update the component.

Method Details

paintFont

Applies the font described by the current font object to the component.

Syntax

object.paintFont ( oComponent )

Parameters

NameTypeOptionalDefaultDescripton
oComponentThecomponent to set the font to

Return Type

void

removeFont

Removes this font from a component. The font styles that this font object has applied to a component will be reset/removed.

Syntax

object.removeFont ( oComponent )

Parameters

NameTypeOptionalDefaultDescripton
oComponentBiComponentThe component to remove the font from

Return Type

void

Static Method Details

fromString

Parses a string and returns a new font object. The format for the string is

"bold"? "italic"? "underline"? "strikeout"? (<size>"px"?)? <font name>?

12px bold italic Arial

The order of the parts is not relevant.

Syntax

BiFont . fromString ( s )

Parameters

NameTypeOptionalDefaultDescripton
sStringThe string to parse

Return Type

BiFont