class TextStyle extends ConfigObject (View source)

Properties

bool $bold Text is bold.
string $color Color of the text.
string $fontName Font name.
int $fontSize Size of font, in pixels.
bool $italic Text is italic.

Methods

mixed
__construct( array $config = array())

Builds the textStyle object when passed an array of configuration options.

array
toArray( string $keyName = null)

Returns an array representation of the object.

array
getValues()

Same as toArray, but without the class name as a key to being multi-dimension.

bold( boolean $bold)

Set bold on/off for the text element.

color( string $color)

Set the color for the text element.

fontName( string $fontName)

Sets the font to the textStyle object.

fontSize( int $fontSize)

Sets the font size to the textStyle.

italic( boolean $italic)

Set italic on/off for the text element.

Details

at line 68
mixed __construct( array $config = array())

Builds the textStyle object when passed an array of configuration options.

Parameters

array $config Array of options.

Return Value

mixed

Exceptions

InvalidConfigValue
InvalidConfigProperty

in ConfigObject at line 93
array toArray( string $keyName = null)

Returns an array representation of the object.

If passed a label, then the array will be returned with the label as the key.

Called with no label returns an array with the classname as the key.

Parameters

string $keyName Key name to be applied to generated array.

Return Value

array Assoc. array of the options of the object.

in ConfigObject at line 115
array getValues()

Same as toArray, but without the class name as a key to being multi-dimension.

Return Value

array Array of the options of the object.

at line 80
TextStyle bold( boolean $bold)

Set bold on/off for the text element.

Parameters

boolean $bold

Return Value

TextStyle

Exceptions

InvalidConfigValue

at line 103
TextStyle color( string $color)

Set the color for the text element.

valid HTML color string, for example: 'red' OR '#004411'

Parameters

string $color Valid HTML color

Return Value

TextStyle

Exceptions

InvalidConfigValue

at line 127
TextStyle fontName( string $fontName)

Sets the font to the textStyle object.

Must be a valid font name.

Parameters

string $fontName Valid font name

Return Value

TextStyle

Exceptions

InvalidConfigValue

at line 148
TextStyle fontSize( int $fontSize)

Sets the font size to the textStyle.

Parameters

int $fontSize Font size in pixels

Return Value

TextStyle

Exceptions

InvalidConfigValue

at line 169
TextStyle italic( boolean $italic)

Set italic on/off for the text element.

Parameters

boolean $italic

Return Value

TextStyle

Exceptions

InvalidConfigValue