AbstractFont
in package
implements
FontInterface, ClassFactoryAwareInterface
AbstractYes
Abstract font base class.
Table of Contents
Interfaces
- FontInterface
- The font interface.
- ClassFactoryAwareInterface
- An interface that classes that accepts a class factory should implement.
Properties
- $color : ColorInterface
- $file : string
- $size : int
- $classFactory : ClassFactoryInterface|null
Methods
- __construct() : mixed
- Constructs a font with specified $file, $size and $color.
- getClassFactory() : ClassFactoryInterface
- Get the class factory instance to be used.
- getColor() : ColorInterface
- Gets font's color.
- 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
Methods
__construct()
Constructs a font with specified $file, $size and $color.
public
__construct(string $file, int $size, ColorInterface $color) : mixed
The font size is to be specified in points (e.g. 10pt means 10)
Parameters
- $file : string
- $size : int
- $color : ColorInterface
getClassFactory()
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
ColorInterfacegetFile()
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