Font
extends AbstractFont
in package
implements
InfoProvider
FinalYes
Font implementation using the Imagick PHP extension.
Table of Contents
Interfaces
- InfoProvider
- Interface implemented by classes that provide info about a graphics driver.
Properties
- $color : ColorInterface
- $file : string
- $size : int
- $classFactory : ClassFactoryInterface|null
- $imagick : Imagick
Methods
- __construct() : mixed
- Constructs a font with specified $file, $size and $color.
- box() : BoxInterface
- Gets BoxInterface of font size on the image based on string and angle.
- getClassFactory() : ClassFactoryInterface
- Get the class factory instance to be used.
- getColor() : ColorInterface
- Gets font's color.
- getDriverInfo() : Info|null
- Get the info about this driver.
- getFile() : string
- Gets the fontfile for current font.
- getSize() : int
- Gets font's integer point size.
- setClassFactory() : $this
- Set the class factory instance to be used.
- wrapText() : string
- Split a string into multiple lines so that it fits a specific width.
Properties
$color
protected
ColorInterface
$color
$file
protected
string
$file
$size
protected
int
$size
$classFactory
private
ClassFactoryInterface|null
$classFactory
$imagick
private
Imagick
$imagick
Methods
__construct()
Constructs a font with specified $file, $size and $color.
public
__construct(Imagick $imagick, string $file, int $size, ColorInterface $color) : mixed
Parameters
- $imagick : Imagick
- $file : string
- $size : int
- $color : ColorInterface
box()
Gets BoxInterface of font size on the image based on string and angle.
public
box(mixed $string[, mixed $angle = 0 ]) : BoxInterface
Parameters
- $string : mixed
- $angle : mixed = 0
Tags
Return values
BoxInterfacegetClassFactory()
Get the class factory instance to be used.
public
getClassFactory() : ClassFactoryInterface
Tags
Return values
ClassFactoryInterfacegetColor()
Gets font's color.
public
final getColor() : ColorInterface
Tags
Return values
ColorInterfacegetDriverInfo()
Get the info about this driver.
public
static getDriverInfo([mixed $required = true ]) : Info|null
Parameters
- $required : mixed = true
-
when the driver is not available: if FALSE the function returns NULL, if TRUE the driver throws a \Imagine\Exception\NotSupportedException
Tags
Return values
Info|nullgetFile()
Gets the fontfile for current font.
public
final getFile() : string
Tags
Return values
stringgetSize()
Gets font's integer point size.
public
final getSize() : int
Tags
Return values
intsetClassFactory()
Set the class factory instance to be used.
public
setClassFactory(ClassFactoryInterface $classFactory) : $this
Parameters
- $classFactory : ClassFactoryInterface
Tags
Return values
$thiswrapText()
Split a string into multiple lines so that it fits a specific width.
public
wrapText(mixed $string, mixed $maxWidth[, mixed $angle = 0 ]) : string
Parameters
- $string : mixed
-
The text to be wrapped
- $maxWidth : mixed
-
The maximum width of the text
- $angle : mixed = 0