\src\Utils\Graphics2D\Shapes\Styles\TextStyle.inc
\Utils\Graphics2D\Shapes\Styles\TextStyle
Package: Default
Parameters
Parameters
Returns
Details
Parameters
Details
Returns
Returns
Returns
Parameters
Returns
Parameters
Returns
This class implements a style for texts.
- Implements
- \Utils\Graphics2D\Shapes\Styles\IStyle
Constants
Properties
Methods


__construct(
string $family
=
'Times', int $size
=
12, \Utils\Color\Color $color
=
null
)
:
void
This acts as the constructor of the class.
Name | Type | Description |
---|---|---|
$family | string | the name of the font family |
$size | int | the font size in pixel |
$color | \Utils\Color\Color | the font color |


__get(
string $memberName
)
:
mixed
This method is a magic getter method for the class.
Name | Type | Description |
---|---|---|
$memberName | string | the name of the member to get |
Type | Description |
---|---|
mixed | the value of the member |
- Todo
- replace this with Trait in PHP 5.4


__set(
string $memberName, mixed $value
)
:
void
This method is a magic setter method for the class.
Name | Type | Description |
---|---|---|
$memberName | string | the name of the member to get |
$value | mixed | the new value of the member |
- Todo
- replace this with Trait in PHP 5.4


__toString(
)
:
string
This method returns a string representation of the text style.
Type | Description |
---|---|
string |


getHash(
)
:
string
This method returns a "hash" of this TextStyle.
Type | Description |
---|---|
string | a "hash" of this TextStyle, consisting of the concatination of the fontFamily and size members of this TextStyle |


getLineHeight(
)
:
int
This method returns the line height for this TextStyle.
Type | Description |
---|---|
int | the line height for this TextStyle in pixels |


pixelToPoint(
int $pixel
)
:
float
static
This method converts from pixel to points unit.
Name | Type | Description |
---|---|---|
$pixel | int | the value in pixels |
Type | Description |
---|---|
float | the value in points |


toCssClass(
string $className
)
:
string
This method converts this TextStyle into a CSS class definition, with the given class name.
Name | Type | Description |
---|---|---|
$className | string | the class name of the CSS class definition |
Type | Description |
---|---|
string | a CSS class definition with the given class name of this TextStlye |