mirror of
https://github.com/Intervention/image.git
synced 2025-08-31 09:31:53 +02:00
Add position to typographic text line
This commit is contained in:
@@ -3,21 +3,29 @@
|
||||
namespace Intervention\Image\Typography;
|
||||
|
||||
use Intervention\Image\Interfaces\FontInterface;
|
||||
use Intervention\Image\Geometry\Point;
|
||||
|
||||
class Line
|
||||
{
|
||||
protected $position;
|
||||
|
||||
public function __construct(protected string $text)
|
||||
{
|
||||
//
|
||||
$this->position = new Point();
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
public function getPosition(): Point
|
||||
{
|
||||
return $this->text;
|
||||
return $this->position;
|
||||
}
|
||||
|
||||
public function width(FontInterface $font): int
|
||||
{
|
||||
return $font->getBoxSize($this->text)->width();
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->text;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user