public function handleTextOverflow($cell, $maxWidth)
    {
        $lines = explode("\n", $cell);
        if ($this->textOverflow == self::WRAP) {
            $maxLineWidth = max(array_map('mb_strlen', $lines));
            if ($maxLineWidth > $maxWidth) {
                $cell = wordwrap($cell, $maxWidth, "\n");
                // Re-explode the lines
                $lines = explode("\n", $cell);
            }
        } elseif ($this->textOverflow == self::ELLIPSIS) {
            if (mb_strlen($lines[0]) > $maxWidth) {
                $lines = [mb_substr($lines[0], 0, $maxWidth - 2) . '..'];
            }
        } elseif ($this->textOverflow == self::CLIP) {
            if (mb_strlen($lines[0]) > $maxWidth) {
                $lines = [mb_substr($lines[0], 0, $maxWidth)];
            }
        }

        return $lines;
    }