public function render(): Image {
        $ftbbox = imageftbbox($this->fontSize, 0, $this->fontFile, $this->text, $this->extraInfo);

        $width = max($ftbbox[2] - $ftbbox[6], 1);
        $height = max($ftbbox[3] - $ftbbox[7], 1);

        // Getting an offset for the first symbol of text
        $ftbbox = imageftbbox($this->fontSize, 0, $this->fontFile, $this->text[0] ?? '', $this->extraInfo);
        $offset = $ftbbox[3] - $ftbbox[7];

        $image = Utility::transparentImage($width, $height);
        imagefttext(
            $image->getResource(),
            $this->fontSize,
            0,
            0,
            $offset,
            $this->color->allocate($image->getResource()),
            $this->fontFile,
            $this->text,
            $this->extraInfo
        );

        return $image;
    }