public static function maxCharWidth($string)
    {
        $chars = preg_split('//u', $string, null, PREG_SPLIT_NO_EMPTY);

        if (!$chars) {
            return 0;
        }

        $sizes = array_map('strlen', $chars);

        return max($sizes);
    }