title: SVG textpath, determine when text goes beyond the path
body: <p>I have got the below code to display text along a path. I am planning to make sort of dynamic where I can just type in what i want and it displays it along the path. Haven't worked out how to do that yet, any suggestions would be mostly welcome.</p>
  
  <p>However my question is, how do I find out exactly at what point the text goes beyond the end of the path and no longer display. The idea is when I have it working dynamically, if the user types a sentence longer than what the path can handle, it will tell you that the text will be cut off from a certain point. in this case the user only sees the words "The quick brown fox jum", the fore I want the error message to say "ps over the lazy dog" could not be displayed or at least at a minimum to the say "The sentence is too long, and is not displayed in full"</p>
  
  <pre><code>&lt;?xml version="1.0" standalone="no"?&gt;
  &lt;!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"&gt; 
  &lt;svg viewBox = "0 0 500 300" version = "1.1"&gt;
      &lt;defs&gt;
        &lt;path id = "s3" d = "M 10,90 Q 100,15 200,70 "/&gt;
      &lt;/defs&gt;
      &lt;g&gt;
          &lt;text font-size = "20"&gt;
              &lt;textPath xlink:href = "#s3"&gt;
                  The quick brown fox jumps over the lazy dog                
              &lt;/textPath&gt;
          &lt;/text&gt;
          &lt;use x = "0" y = "0" xlink:href = "#s3" stroke = "black" fill = "none"/&gt;
      &lt;/g&gt;
  &lt;/svg&gt;
  </code></pre>