Font
in package
Represents a font.
This class provides properties and methods for handling fonts.
Table of Contents
Properties
- $angle : int
- $file : string
- $path : string
- $size : int
- $src : string
- $_angle : int
- The tilt angle.
- $_file : string
- The font name.
- $_fontSize : int
- The font size.
- $_path : string
- The file path.
Methods
- __construct() : mixed
- Constructs a new Font instance.
- __get() : mixed
- Magic getter method.
- InscribeText() : void
- Inscribes text within a given area.
- MeasureText() : Rect
- Measures the size of the text area.
Properties
$angle read-only
public
int
$angle
The angle of the font.
$file read-only
public
string
$file
The name of the font file.
$path read-only
public
string
$path
The path to the fonts.
$size read-only
public
int
$size
The font size.
$src read-only
public
string
$src
The full path to the font.
$_angle
The tilt angle.
private
int
$_angle
$_file
The font name.
private
string
$_file
$_fontSize
The font size.
private
int
$_fontSize
$_path
The file path.
private
string
$_path
Methods
__construct()
Constructs a new Font instance.
public
__construct(string $fontFile[, string $path = '' ][, int $fontSize = 0 ][, int $angle = 0 ]) : mixed
Parameters
- $fontFile : string
-
The font file name.
- $path : string = ''
-
The path to the font files.
- $fontSize : int = 0
-
The font size.
- $angle : int = 0
-
The angle of the font.
__get()
Magic getter method.
public
__get(string $prop) : mixed
Parameters
- $prop : string
-
The property name.
Return values
mixed —The value of the property.
InscribeText()
Inscribes text within a given area.
public
InscribeText(string $text, Point &$startAt, Size &$size) : void
Parameters
MeasureText()
Measures the size of the text area.
public
MeasureText(string $text) : Rect
Parameters
- $text : string
-
The text to measure.
Return values
Rect —The size of the text area.