title: Getting the size of text without using the boundingBox function in Raphael javascript library
body: <p>I am trying to create some buttons with text in javascript using the Rahpael library. I  would like to know the size of the styled text, before drawing to avoid that so I can create proper background (the button). Also I would like to avoid drawing the text outside of the canvas/paper (the position of the text  is the position of its center).</p>
  
  <p>I can use Raphaels getBBox() method, but I have to create (draw) the text in first place to do this. So I draw text to get the size to be able to draw it on the right position. This is ugly. So I am searching for some general method to estimate the metrics of styled text for given font, font-size, family ...</p>
  
  <p>There is a possibility to do this using the HTML5 canvas <a href="http://www.html5canvastutorials.com/tutorials/html5-canvas-text-metrics/" rel="nofollow">http://www.html5canvastutorials.com/tutorials/html5-canvas-text-metrics/</a> but Raphael do not use canvas. Is there any possibility to get the text metrics using Raphael or plain Javascript?</p>