static
TIC
factory
(
string $font)
-
string
$font: Path to a font
TIC
__construct
(string $font)
-
string
$font: Path to a font
Redefined in descendants as:
Free $this->gd resource
void
__destruct
()
Creates the image with the text, optionally output the image
TIC
create
([
boolean $render =
false], [
string $type =
'png'])
-
boolean
$render: Set to true to render the image
-
string
$type: png|jpg|jpeg|gif
Redefined in descendants as:
Calculates text width, height and x, y coordinates where drawing starts.
If a parameter is not passed or passed with negative value then the class property is going to be used
array
dimension
([string $text = -1], [int $size = -1], [int $angle = -1], [string $font = -1])
-
string
$text: If -1 then $this->text is going to be used
-
int
$size: font size, depending on GD version is going to be interpreded as points or pixels
-
int
$angle: Angle in degree text should be written into image.
-
string
$font: Full or Relative path to a True type font
Redefined in descendants as:
void
render
([string $type = 'png'])
-
string
$type: Supported types are 'png', 'jpeg|jpg' and gif
TIC
setAngle
(
int $angle)
-
int
$angle: Angle to write the text in
TIC
setBgColor
(
int|array $rgb, [
int $g =
0x00], [
int $b =
0x00])
-
int|array
$rgb: If int (red) should be between 0 and 255, if array should have 3 ints, each between 0 and 255
-
int
$g: Ignored if $rgb is an array, is the green part of RGB
-
int
$b: Ignored if $rgb is an array, is the blue part of RGB
TIC
setFontColor
(
int|array $rgb, [
int $g =
0x00], [
int $b =
0x00])
-
int|array
$rgb: If int (red) should be between 0 and 255, if array should have 3 ints, each between 0 and 255
-
int
$g: Ignored if $rgb is an array, is the green part of RGB
-
int
$b: Ignored if $rgb is an array, is the blue part of RGB
TIC
setFontSize
(
int $size)
-
int
$size: Set the font size
TIC
setHorAlign
([
bool $align =
true])
-
bool
$align: If true align text
TIC
setHorPadding
(
int $padding)
-
int
$padding: The horizonal padding (left and right) between the text and the border of the image
TIC
setImgHeight
(
int $height)
-
int
$height: Set the height of the image
TIC
setImgWidth
(
int $width)
-
int
$width: Set the width of the image
void
setPadding
( $padding)
TIC
setText
(
string $text)
-
string
$text: Text to write in the image
TIC
setVerAlign
([
bool $valign =
true])
-
bool
$valign: If true valign text
TIC
setVerPadding
(
int $padding)
-
int
$padding: The vertical padding (top and bottom) between the text and the border of the image
Wraps $this->text into multiple lines if wider then $this->width - ($this->padding * 2)
void
wrap_text
()
Wraps a word into multiple lines if the word is wider than $this->imgWidth
void
wrap_word
( &$lines, &$wline, $line, $max_width)
-
&$lines
-
&$wline
-
$line
-
$max_width