int measureText(CanvasRenderingContext2D ctx, String text) { return (ctx.measureText(text).width).round(); }