class Font extends AbstractFont

Font implementation using the Gmagick PHP extension.

Properties

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

Methods

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

No description

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.

box(string $string, int $angle = 0)

Gets BoxInterface of font size on the image based on string and angle.

Details

at line 33
__construct(Gmagick $gmagick, string $file, int $size, ColorInterface $color)

Parameters

Gmagick $gmagick
string $file
int $size
ColorInterface $color

in AbstractFont at line 66
final string getFile()

Gets the fontfile for current font.

Return Value

string

See also

FontInterface::getFile

in AbstractFont at line 76
final int getSize()

Gets font's integer point size.

Return Value

int

See also

FontInterface::getSize

in AbstractFont at line 86
final ColorInterface getColor()

Gets font's color.

Return Value

ColorInterface

See also

FontInterface::getColor

in AbstractFont 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

in AbstractFont at line 135
ClassFactoryInterface getClassFactory()

Get the class factory instance to be used.

in AbstractFont 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

at line 45
BoxInterface box(string $string, int $angle = 0)

Gets BoxInterface of font size on the image based on string and angle.

Parameters

string $string
int $angle

Return Value

BoxInterface

See also

FontInterface::box