Properties

$text

$text : string

Text to be written

Type

string

$size

$size : int

Text size in pixels

Type

int

$color

$color : mixed

Color of the text

Type

mixed

$angle

$angle : int

Rotation angle of the text

Type

int

$align

$align : string

Horizontal alignment of the text

Type

string

$valign

$valign : string

Vertical alignment of the text

Type

string

$kerning

$kerning : float

Space between text characters

Type

float

$file

$file : mixed

Path to TTF or GD library internal font file of the text

Type

mixed

Methods

applyToImage()

applyToImage(\Intervention\Image\Image  $image, int  $posx, int  $posy) : bool

Draws font to given image on given position

Parameters

\Intervention\Image\Image $image
int $posx
int $posy

Returns

bool —

getBoxSize()

getBoxSize() : array

Calculates bounding box of current font setting

Returns

array —

__construct()

__construct(string  $text = null) : mixed

Create a new instance of Font

Parameters

string $text

Text to be written

Returns

mixed —

text()

text(string  $text) : self

Set text to be written

Parameters

string $text

Returns

self —

getText()

getText() : string

Get text to be written

Returns

string —

size()

size(int  $size) : self

Set font size in pixels

Parameters

int $size

Returns

self —

getSize()

getSize() : int

Get font size in pixels

Returns

int —

color()

color(mixed  $color) : self

Set color of text to be written

Parameters

mixed $color

Returns

self —

getColor()

getColor() : mixed

Get color of text

Returns

mixed —

angle()

angle(int  $angle) : self

Set rotation angle of text

Parameters

int $angle

Returns

self —

getAngle()

getAngle() : int

Get rotation angle of text

Returns

int —

align()

align(string  $align) : self

Set horizontal text alignment

Parameters

string $align

Returns

self —

getAlign()

getAlign() : string

Get horizontal text alignment

Returns

string —

valign()

valign(string  $valign) : self

Set vertical text alignment

Parameters

string $valign

Returns

self —

getValign()

getValign() : string

Get vertical text alignment

Returns

string —

kerning()

kerning(string  $kerning) : void

Set text kerning

Parameters

string $kerning

getKerning()

getKerning() : float

Get kerning

Returns

float —

file()

file(string  $file) : self

Set path to font file

Parameters

string $file

Returns

self —

getFile()

getFile() : string

Get path to font file

Returns

string —

countLines()

countLines() : int

Counts lines of text to be written

Returns

int —

hasApplicableFontFile()

hasApplicableFontFile() : bool

Checks if current font has access to an applicable font file

Returns

bool —