width($width); $this->height($height); } /** * TextFit named constructor. * * @param int|string|Expression $width The width in pixels. * @param int|string|Expression $height The height in pixels. * * @return $this */ public static function size($width, $height = null) { return new TextFit($width, $height); } /** * Sets the width of the text. * * @param int|string|Expression $width The width in pixels. * * @return static */ public function width($width) { $this->setDimension(ClassUtils::verifyInstance($width, Width::class)); return $this; } /** * Sets the height of the text. * * @param int|string|Expression $height The height in pixels. * * @return static */ public function height($height) { $this->setDimension(ClassUtils::verifyInstance($height, Height::class)); return $this; } /** * Internal setter for the dimensions. * * @param mixed $value The dimension. * * @return static * * @internal */ protected function setDimension($value = null) { $this->addQualifier($value); return $this; } }