app/Report/ReportHtml.php
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;
    }
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;
    }
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 ; }
Wrap text - ReportHtml

@param string $str   Text to wrap
@param float  $width Width in points the text has to fit into

@return string
Wrap text - ReportHtml