drawGlyph(ctx, index) {
    const glyph = this.glyphs[index];
    const vxy = this._2v(index);

    ctx.beginPath();
    glyph.forEach(contour => {
      ctx.moveTo(...vxy(contour[0]));
      let i = 0;
      while (i < contour.length - 1) {
        if (!contour[i].on) throw Error(`Invalid cubic curve: ${contour}`);
        if (!contour[i+1].on) {
          const end_pt = i+3 < contour.length ? contour[i+3] : contour[0];
          ctx.bezierCurveTo(...vxy(contour[i+1]), 
            ...vxy(contour[i+2]), ...vxy(end_pt));
          i+=3;
        } else {
          const end_pt = i+1 < contour.length ? contour[i+1] : contour[0];
          ctx.lineTo(...vxy(end_pt));
          i++;
        }
      }
    });
    ctx.closePath();
    ctx.fill();
  }
Draw a single glyph
@param { CanvasRenderingContext2D } ctx 
@param { number } index