Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obtain result of "imagettftext" of method write of Adapter (GD, ...) #153

Open
developez opened this issue May 18, 2018 · 0 comments
Open

Comments

@developez
Copy link

developez commented May 18, 2018

I need to obtain the result of imagettftext that is called on write method of GD class.

To do this I put a variable on GD called "last_write" to get the last result of this operation. The thing is that I modify the code on GD.php file but the changes dont seem to happen. Do I need to update composer or similar thing?

class GD extends Common
{
	public $last_write;

...

    public function write($font, $text, $x = 0, $y = 0, $size = 12, $angle = 0, $color = 0x000000, $align = 'left')
    {		
        imagealphablending($this->resource, true);

        if ($align != 'left') {
            $sim_size = self::TTFBox($font, $text, $size, $angle);

            if ($align == 'center') {
                $x -= $sim_size['width'] / 2;
            }

            if ($align == 'right') {
                $x -= $sim_size['width'];
            }
        }		
        $this->last_write = imagettftext($this->resource, $size, $angle, $x, $y, ImageColor::gdAllocate($this->resource, $color), $font, $text);						
				
        return $this;
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant