remove dependence on canvas.text