private function drawText(Text $text, $canvas)
    {
        list($red, $green, $blue) = $text->getColor();
        $opacity = Utils::fixPNGOpacity($text->getOpacity());

        $color = imagecolorallocatealpha(
            $canvas,
            $red,
            $green,
            $blue,
            $opacity < 127 ? $opacity : null
        );

        $size = $text->getSize();
        $angle = $text->getAngle();
        $font = $text->getFontface();
        $lineHeight = $text->getLineHeight() * $text->getSize();

        list($x, $y) = $text->getCords();

        $lines = $text->wrappText();

        foreach ($lines as $i => $line) {
            $ny = $y + ($lineHeight * $i);
            imagealphablending($canvas, true);
            imagettftext($canvas, $size, $angle, $x, $ny, $color, $font, $line);
        }
    }
private function drawText(Text $text, $canvas)
    {
        list($red, $green, $blue) = $text->getColor();
        $opacity = Utils::fixPNGOpacity($text->getOpacity());

        $color = imagecolorallocatealpha(
            $canvas,
            $red,
            $green,
            $blue,
            $opacity < 127 ? $opacity : null
        );

        $size = $text->getSize();
        $angle = $text->getAngle();
        $font = $text->getFontface();
        $lineHeight = $text->getLineHeight() * $text->getSize();

        list($x, $y) = $text->getCords();

        $lines = $text->wrappText();

        foreach ($lines as $i => $line) {
            $ny = $y + ($lineHeight * $i);
            imagealphablending($canvas, true);
            imagettftext($canvas, $size, $angle, $x, $ny, $color, $font, $line);
        }
    }
private function drawText ( Text $ text , $ canvas ) { list ( $ red , $ green , $ blue ) = $ text -> getColor ( ) ; $ opacity = Utils :: fixPNGOpacity ( $ text -> getOpacity ( ) ) ; $ color = imagecolorallocatealpha ( $ canvas , $ red , $ green , $ blue , $ opacity < 127 ? $ opacity : null ) ; $ size = $ text -> getSize ( ) ; $ angle = $ text -> getAngle ( ) ; $ font = $ text -> getFontface ( ) ; $ lineHeight = $ text -> getLineHeight ( ) * $ text -> getSize ( ) ; list ( $ x , $ y ) = $ text -> getCords ( ) ; $ lines = $ text -> wrappText ( ) ; foreach ( $ lines as $ i => $ line ) { $ ny = $ y + ( $ lineHeight * $ i ) ; imagealphablending ( $ canvas , true ) ; imagettftext ( $ canvas , $ size , $ angle , $ x , $ ny , $ color , $ font , $ line ) ; } }
Draw a Text element.

@param  \GImage\Text $text Text element.
@param mixed         $canvas
@return void
Draw a Text element .