private function calculateCharacterWith($fontName, $fontSize, $char)
    {
        if (isset($this->fonts[$fontName])) {
            $box = imageftbbox($fontSize, 0, $this->fonts[$fontName], str_repeat($char, 100));
            $width = abs($box[4] - $box[0]) / 6.73 / 100;
            return round($width, 3);
        }

        return 0.1 * $fontSize;
    }
private function calculateCharacterWith($fontName, $fontSize, $char)
    {
        if (isset($this->fonts[$fontName])) {
            $box = imageftbbox($fontSize, 0, $this->fonts[$fontName], str_repeat($char, 100));
            $width = abs($box[4] - $box[0]) / 6.73 / 100;
            return round($width, 3);
        }

        return 0.1 * $fontSize;
    }
private function calculateCharacterWith ( $ fontName , $ fontSize , $ char ) { if ( isset ( $ this -> fonts [ $ fontName ] ) ) { $ box = imageftbbox ( $ fontSize , 0 , $ this -> fonts [ $ fontName ] , str_repeat ( $ char , 100 ) ) ; $ width = abs ( $ box [ 4 ] - $ box [ 0 ] ) / 6.73 / 100 ; return round ( $ width , 3 ) ; } return 0.1 * $ fontSize ; }
Calculate the width of a single character for the given fontname and size.
Create image that contains the character 100 times to get more accurate results.

@param string $fontName
@param int    $fontSize
@param string $char

@return float
Calculate the width of a single character for the given fontname and size . Create image that contains the character 100 times to get more accurate results .