Esempio n. 1
0
 public function __construct($fontFile, $fontSize, Color $color, $text)
 {
     $boxSize = imagettfbbox($fontSize, 0, $fontFile, $text);
     $width = $boxSize[4] - $boxSize[6];
     $height = $boxSize[1] - $boxSize[7];
     parent::__construct($width, $height, true);
     $color = imagecolorallocate($this->resource, $color->getR(), $color->getG(), $color->getB());
     imagettftext($this->resource, $fontSize, 0, 0, $this->height, $color, $fontFile, $text);
 }