title: Choosing font size on a text path
body: <p>I'm working on a radial menu (for a game) and I'm having some trouble with getting text along paths to behave exactly how I'd like it to. <a href="http://www.placeholder-software.co.uk/static-files/.radial/radial.html" rel="nofollow noreferrer">Here's</a> an example of the menu at the moment:</p>
  
  <p><img src="https://i.imgur.com/sO0LDHL.png" alt="Slightly Broken"></p>
  
  <p>I want all the text to be aligned to the center of the node it's in, and for the fontSize to be sufficiently small for the text to fit into the available space. This is achieved fairly trivially for the straight text by scalingthe font and measuring the width until it fits:</p>
  
  <pre><code>var fontSize = 19;
  var titleText = new Kinetic.Text({
      text: title,
      fontSize: fontSize ,
      fontFamily: 'Calibri',
      fill: 'white',
      rotationDeg: rotation
  });
  
  
  while (titleText.getWidth() &gt; availableSpace)
      titleText.setFontSize(--fontSize);
  </code></pre>
  
  <p>However, this approach can't be applied to the curved text because (as far as I can see) there's no way to measure how long a string is when placed along a path.</p>
  
  <p><em>How should I achieve centering and scaling of text when it is placed along a path?</em></p>