Font
extends AbstractFont
in package
Table of Contents
Properties
- $align : string
- Horizontal alignment of the text
- $angle : int
- Rotation angle of the text
- $color : mixed
- Color of the text
- $file : mixed
- Path to TTF or GD library internal font file of the text
- $kerning : float
- Space between text characters
- $size : int
- Text size in pixels
- $text : string
- Text to be written
- $valign : string
- Vertical alignment of the text
Methods
- __construct() : mixed
- Create a new instance of Font
- align() : void
- Set horizontal text alignment
- angle() : void
- Set rotation angle of text
- applyToImage() : void
- Draws font to given image at given position
- color() : void
- Set color of text to be written
- countLines() : int
- Counts lines of text to be written
- file() : void
- Set path to font file
- getAlign() : string
- Get horizontal text alignment
- getAngle() : int
- Get rotation angle of text
- getBoxSize() : array<string|int, mixed>
- Calculates bounding box of current font setting
- getColor() : mixed
- Get color of text
- getFile() : string
- Get path to font file
- getKerning() : float
- Get kerning
- getSize() : int
- Get font size in pixels
- getText() : string
- Get text to be written
- getValign() : string
- Get vertical text alignment
- kerning() : void
- Set text kerning
- size() : void
- Set font size in pixels
- text() : void
- Set text to be written
- valign() : void
- Set vertical text alignment
- hasApplicableFontFile() : bool
- Checks if current font has access to an applicable font file
Properties
$align
Horizontal alignment of the text
public
string
$align
$angle
Rotation angle of the text
public
int
$angle
= 0
$color
Color of the text
public
mixed
$color
= '000000'
$file
Path to TTF or GD library internal font file of the text
public
mixed
$file
$kerning
Space between text characters
public
float
$kerning
= 0
$size
Text size in pixels
public
int
$size
= 12
$text
Text to be written
public
string
$text
$valign
Vertical alignment of the text
public
string
$valign
Methods
__construct()
Create a new instance of Font
public
__construct([string $text = null ]) : mixed
Parameters
- $text : string = null
-
Text to be written
align()
Set horizontal text alignment
public
align(string $align) : void
Parameters
- $align : string
angle()
Set rotation angle of text
public
angle(int $angle) : void
Parameters
- $angle : int
applyToImage()
Draws font to given image at given position
public
applyToImage(Image $image[, int $posx = 0 ][, int $posy = 0 ]) : void
Parameters
- $image : Image
- $posx : int = 0
- $posy : int = 0
color()
Set color of text to be written
public
color(mixed $color) : void
Parameters
- $color : mixed
countLines()
Counts lines of text to be written
public
countLines() : int
Return values
intfile()
Set path to font file
public
file(string $file) : void
Parameters
- $file : string
getAlign()
Get horizontal text alignment
public
getAlign() : string
Return values
stringgetAngle()
Get rotation angle of text
public
getAngle() : int
Return values
intgetBoxSize()
Calculates bounding box of current font setting
public
getBoxSize() : array<string|int, mixed>
Return values
array<string|int, mixed>getColor()
Get color of text
public
getColor() : mixed
getFile()
Get path to font file
public
getFile() : string
Return values
stringgetKerning()
Get kerning
public
getKerning() : float
Return values
floatgetSize()
Get font size in pixels
public
getSize() : int
Return values
intgetText()
Get text to be written
public
getText() : string
Return values
stringgetValign()
Get vertical text alignment
public
getValign() : string
Return values
stringkerning()
Set text kerning
public
kerning(string $kerning) : void
Parameters
- $kerning : string
size()
Set font size in pixels
public
size(int $size) : void
Parameters
- $size : int
text()
Set text to be written
public
text(string $text) : void
Parameters
- $text : string
valign()
Set vertical text alignment
public
valign(string $valign) : void
Parameters
- $valign : string
hasApplicableFontFile()
Checks if current font has access to an applicable font file
protected
hasApplicableFontFile() : bool