_add(l, text, mod = "normal") {
    if (this.lines[l] === undefined) {
      this.lines[l] = {
        width: 0,
        height: 0,
        blocks: [],
      };
    }

    // We still need to set a block for undefined and empty texts, hence return at this point
    // This is necessary because we don't know at this point if we're at the
    // start of an empty line or not.
    // To compensate, empty blocks are removed in `finalize()`.
    //
    // Empty strings should still have a height
    let tmpText = text;
    if (text === undefined || text === "") tmpText = " ";

    // Determine width and get the font properties
    const result = this.measureText(tmpText, mod);
    const block = Object.assign({}, result.values);
    block.text = text;
    block.width = result.width;
    block.mod = mod;

    if (text === undefined || text === "") {
      block.width = 0;
    }

    this.lines[l].blocks.push(block);

    // Update the line width. We need this for determining if a string goes over max width
    this.lines[l].width += block.width;
  }
Append given text to the given line.
@param {number}  l    index of line to add to
@param {string}  text string to append to line
@param {'bold'|'ital'|'boldital'|'mono'|'normal'} [mod]
@private