HTML Canvas allows for the drawing of text with
ctx.fillStyle = "666"; // text color ctx.textAlign = "center"; // alignment ctx.font = "normal 12px Helvetica Neue"; // font ctx.fillText("my Text, x , y); // drawSometimes, you might want to draw a border around the text. Getting the textHeight should not present a problem, after all we can set the font size directly. But textWidth is not fixed in that way, because it depends (nnnn) on the actual text that is being displayed. ctx.measureText takes the text as an argument and returns an object with a width property, describing the width of the text.
var texttWidth = ctx.measureText(columnName).width;width is for now the only inhabitant of that object, but it would be a fair guess, that it might be more densely populate in the future.