public function textWrap(string $str, float $width): string
    {
        // Calculate the line width
        $lw = (int) ($width / ($this->getCurrentStyleHeight() / 2));
        // Wordwrap each line
        $lines = explode("\n", $str);
        // Line Feed counter
        $lfct     = count($lines);
        $wraptext = '';
        foreach ($lines as $line) {
            $wtext = FunctionsRtl::utf8WordWrap($line, $lw, "\n", true);
            $wraptext .= $wtext;
            // Add a new line as long as it’s not the last line
            if ($lfct > 1) {
                $wraptext .= "\n";
            }
            $lfct--;
        }

        return $wraptext;
    }