returns array of lines
function splitLongWord(word, widths_array, firstLineMaxLen, maxLen) {
    var answer = []; // 1st, chop off the piece that can fit on the hanging line.

    var i = 0,
        l = word.length,
        workingLen = 0;

    while (i !== l && workingLen + widths_array[i] < firstLineMaxLen) {
      workingLen += widths_array[i];
      i++;
    } // this is first line.


    answer.push(word.slice(0, i)); // 2nd. Split the rest into maxLen pieces.

    var startOfLine = i;
    workingLen = 0;

    while (i !== l) {
      if (workingLen + widths_array[i] > maxLen) {
        answer.push(word.slice(startOfLine, i));
        workingLen = 0;
        startOfLine = i;
      }

      workingLen += widths_array[i];
      i++;
    }

    if (startOfLine !== i) {
      answer.push(word.slice(startOfLine, i));
    }

    return answer;
  }