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

Name Type Optional Default Descripton
nSize Number checked The font size in pixels
sName String checked The font name

Properties

Name Type get set Descripton
bold Boolean checked checked Whether to use bold
italic Boolean checked checked Whether to use italic
name String checked checked The name of the font. A comma seprated list also works
size Number checked checked The font size (in pixels)
strikeout Boolean checked checked Whether to line through the text
underline Boolean checked checked Whether to underline the text

Methods

Name Description
paintFont Makes the component have a font described by the current font object
removeFont Removes this font from a component. This means that the font styles this font object has applied to a component will be reset/removed.

Events

None.

Static Methods

Name Description
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.

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

Makes the component have a font described by the current font object

Syntax

object.paintFont
 (
 oComponent
 )
 

Parameters

Name Type Optional Default Descripton
oComponent BiComponent The component to set the font to

Return Type

void

removeFont

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

Syntax

object.removeFont
 (
 oComponent
 )
 

Parameters

Name Type Optional Default Descripton
oComponent BiComponent The 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

Name Type Optional Default Descripton
s String The string to parse

Return Type

BiFont