1
0
mirror of https://github.com/Intervention/image.git synced 2025-09-02 18:32:56 +02:00

Add position to typographic text line

This commit is contained in:
Oliver Vogel
2022-06-26 09:20:26 +02:00
parent 0e2aa7f595
commit e1e1291fc5

View File

@@ -3,21 +3,29 @@
namespace Intervention\Image\Typography; namespace Intervention\Image\Typography;
use Intervention\Image\Interfaces\FontInterface; use Intervention\Image\Interfaces\FontInterface;
use Intervention\Image\Geometry\Point;
class Line class Line
{ {
protected $position;
public function __construct(protected string $text) 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 public function width(FontInterface $font): int
{ {
return $font->getBoxSize($this->text)->width(); return $font->getBoxSize($this->text)->width();
} }
public function __toString(): string
{
return $this->text;
}
} }