HumHub Documentation (unofficial)

Font extends AbstractFont
in package
implements InfoProvider

FinalYes

Font implementation using the GD library.

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

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

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

getDriverInfo()

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
see
InfoProvider::getDriverInfo()
since
1.3.0
Return values
Info|null

wrapText()

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
Tags
see
FontInterface::wrapText()
Return values
string

        
On this page

Search results