abstract class AbstractFont implements FontInterface, ClassFactoryAwareInterface

Abstract font base class.

Properties

protected string $file
protected int $size
protected ColorInterface $color

Methods

__construct(string $file, int $size, ColorInterface $color)

Constructs a font with specified $file, $size and $color.

string
getFile()

Gets the fontfile for current font.

int
getSize()

Gets font's integer point size.

getColor()

Gets font's color.

string
wrapText(string $string, int $maxWidth, int $angle = 0)

Split a string into multiple lines so that it fits a specific width.

getClassFactory()

Get the class factory instance to be used.

$this
setClassFactory(ClassFactoryInterface $classFactory)

Set the class factory instance to be used.

Details

at line 54
__construct(string $file, int $size, ColorInterface $color)

Constructs a font with specified $file, $size and $color.

The font size is to be specified in points (e.g. 10pt means 10)

Parameters

string $file
int $size
ColorInterface $color

at line 66
final string getFile()

Gets the fontfile for current font.

Return Value

string

See also

FontInterface::getFile

at line 76
final int getSize()

Gets font's integer point size.

Return Value

int

See also

FontInterface::getSize

at line 86
final ColorInterface getColor()

Gets font's color.

Return Value

ColorInterface

See also

FontInterface::getColor

at line 96
string wrapText(string $string, int $maxWidth, int $angle = 0)

Split a string into multiple lines so that it fits a specific width.

Parameters

string $string The text to be wrapped
int $maxWidth The maximum width of the text
int $angle

Return Value

string

See also

FontInterface::wrapText

at line 135
ClassFactoryInterface getClassFactory()

Get the class factory instance to be used.

at line 149
$this setClassFactory(ClassFactoryInterface $classFactory)

Set the class factory instance to be used.

Parameters

ClassFactoryInterface $classFactory

Return Value

$this

See also

ClassFactoryAwareInterface::setClassFactory