PHP Класс JBZoo\Image\Text

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_default

Открытые методы

Метод Описание
render ( mixed $image, string $text, string $fFile, array $params = [] ) Add text to an image

Защищенные методы

Метод Описание
_getColor ( mixed $image, string | array $colors ) : array Determine text color
_getStrokeX ( string $fontSize, integer $angle, string $fontFile, array $letters, string $charKey, integer $strokeSpacing, integer $textX ) : integer Get X offset for stroke rendering mode
_getTextboxSize ( string $fontSize, integer $angle, string $fontFile, string $text ) : array Determine textbox size
_render ( mixed $image, string $text, array $font, array $coords ) : array Compact args for imagettftext()
_renderStroke ( mixed $image, string $text, array $font, array $coords, array $stroke ) : array Same as imagettftext(), but allows for a stroke color and size

Описание методов

_getColor() защищенный статический Метод

Determine text color
protected static _getColor ( mixed $image, string | array $colors ) : array
$image mixed GD resource
$colors string | array
Результат array

_getStrokeX() защищенный статический Метод

Get X offset for stroke rendering mode
protected static _getStrokeX ( string $fontSize, integer $angle, string $fontFile, array $letters, string $charKey, integer $strokeSpacing, integer $textX ) : integer
$fontSize string
$angle integer
$fontFile string
$letters array
$charKey string
$strokeSpacing integer
$textX integer
Результат integer

_getTextboxSize() защищенный статический Метод

Determine textbox size
protected static _getTextboxSize ( string $fontSize, integer $angle, string $fontFile, string $text ) : array
$fontSize string
$angle integer
$fontFile string
$text string
Результат array

_render() защищенный статический Метод

Compact args for imagettftext()
protected static _render ( mixed $image, string $text, array $font, array $coords ) : array
$image mixed A GD image object
$text string The text to output
$font array [$fontfile, $fontsize, $color, $angle]
$coords array [X,Y] Coordinate of the starting position
Результат array

_renderStroke() защищенный статический Метод

Same as imagettftext(), but allows for a stroke color and size
protected static _renderStroke ( mixed $image, string $text, array $font, array $coords, array $stroke ) : array
$image mixed A GD image object
$text string The text to output
$font array [$fontfile, $fontsize, $color, $angle]
$coords array [X,Y] Coordinate of the starting position
$stroke array [$strokeSize, $strokeColor]
Результат array

render() публичный статический Метод

Add text to an image
public static render ( mixed $image, string $text, string $fFile, array $params = [] )
$image mixed GD resource
$text string Some text to output on image as watermark
$fFile string TTF font file path
$params array Additional render params

Описание свойств

$_default защищенное статическое свойство

protected static $_default