code: function (text, color, x, y, width) {
                          ctx.fillStyle = color;
                          var metric = ctx.measureText(text);
                          if (metric.width > width) {
                              while (text !== "") {
                                  metric = ctx.measureText(text + "...");
                                  if (metric.width <= width) {
                                      text += "...";
                                      break;
                                  }
                                  text = text.substr(0, text.length - 1);
                              }
                          }
                          ctx.fillText(text, x, y, width);
                      }
docs: /*  common text rendering