public static function wrap($comment, $format, $width = 80)
    {
        $result = array();
        $width = $width - self::getWidth($format);
        // collect lines
        $lines = array();
        foreach (explode("\n", $comment) as $line) {
            foreach (explode("\n", wordwrap($line, $width, "\n")) as $sline) {
                $lines[] = $sline;
            }
        }
        // write lines
        $no = 0;
        $count = count($lines);
        foreach ($lines as $line) {
            $no++;
            self::getLine($no, $count, $format, $line, $result);
        }

        return $result;
    }