Calculate exact character\string height in javascript
Width is easy: canvas’s context has a built in metric for measuring text width. // this will measure text width context.font=”14pt Verdana”; var m=context.measureText(yourText); var theWidth=m.width; Height is more difficult because measureText doesn’t compute height. You can often use the font size to approximate the height–that’s what I do. But if you really need more … Read more