updateLayout() {
    const origins = this._origins = [];
    for (let i = 0; i < this._glyphs.length; i++) {
      if (origins.length === 0)
        origins.push([ 0, this._nextline(0) ]);
      else {
        let x = this._advance(origins[i-1][0], this.glyphWidth(i-1));
        let y = origins[i-1][1];
        if (x + this.glyphWidth(i)/this.upm*this._fontSize > this.width) { 
          x = 0; y = this._nextline(y);
        }
        origins.push([ x, y ]);
      }
    }
  }
Update the origins for layout greedily.