Documentation

AbstractFont
in package

AbstractYes

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()  : bool
Draws font to given image on 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

$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

$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 on given position

public abstract applyToImage(Image $image[, int $posx = 0 ][, int $posy = 0 ]) : bool
Parameters
$image : Image
$posx : int = 0
$posy : int = 0
Return values
bool

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
int

file()

Set path to font file

public file(string $file) : void
Parameters
$file : string

getAlign()

Get horizontal text alignment

public getAlign() : string
Return values
string

getAngle()

Get rotation angle of text

public getAngle() : int
Return values
int

getBoxSize()

Calculates bounding box of current font setting

public abstract getBoxSize() : array<string|int, mixed>
Return values
array<string|int, mixed>

getFile()

Get path to font file

public getFile() : string
Return values
string

getKerning()

Get kerning

public getKerning() : float
Return values
float

getSize()

Get font size in pixels

public getSize() : int
Return values
int

getText()

Get text to be written

public getText() : string
Return values
string

getValign()

Get vertical text alignment

public getValign() : string
Return values
string

kerning()

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
Return values
bool

        
On this page

Search results