JBZoo\Image\Text::_getTextboxSize PHP Метод

_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
    protected static function _getTextboxSize($fontSize, $angle, $fontFile, $text)
    {
        // Determine textbox size
        $fontPath = FS::clean($fontFile);
        if (!FS::isFile($fontPath)) {
            throw new Exception('Unable to load font: ' . $fontFile);
        }
        $box = imagettfbbox($fontSize, $angle, $fontFile, $text);
        $boxWidth = abs($box[6] - $box[2]);
        $boxHeight = abs($box[7] - $box[1]);
        return array($boxWidth, $boxHeight);
    }