title: Write scaled text in Svg shape
body: <p>I'm am trying to draw a scaled text with position number for each Svg shape on Android. </p>
  
  <p>Something like this:
  <a href="http://static-4.app4smart.me/uploads/posts/thumbs/13284/f-9553-1971d66549.jpg" rel="nofollow noreferrer">http://static-4.app4smart.me/uploads/posts/thumbs/13284/f-9553-1971d66549.jpg</a></p>
  
  <p>Does anyone have any idea how it can be implemented? 
  The main problem is to find the better place for placing the text inside shape, and to scale it according to size of svg shape.</p>
  
  <p>Actually I figured out how to put and scale text like in example below:</p>
  
  <pre><code>&lt;svg x="0px" y="0px"
   viewBox="0 0 800 800" style="enable-background:new 0 0 800 
  800;" xml:space="preserve"&gt;
  &lt;polygon style="fill:#E2BE9C;" points="509.8,704.8 517.4,799.3 
  436.4,799.3 399.5,757.9 409.6,661.6 440,620.3 "/&gt;
  &lt;text xmlns="http://www.w3.org/2000/svg" x="458" y="709" text- 
  anchor="middle" textLength="20" lengthAdjust="spacingAndGlyphs" 
  font- 
  size="10"&gt;Hey!&lt;/text&gt;
  &lt;/svg&gt;
  </code></pre>
  
  <p>Here I just get the RectF of Path object and get the exact center where I put the text. 
  But I still can't find the better place to put the text and how big/ small it must be scaled. </p>
  
  <p>Because for such shape this approach can't be applied.</p>
  
  <pre><code> &lt;svg x="0px" y="0px"
           viewBox="0 0 800 800" style="enable-background:new 0 0 800 
      800;" xml:space="preserve"&gt;
      &lt;polygon style="fill:#58585A;" points="201.7,175.9 294.4,146.9 
      414.9,170.2 252.5,191.4 159.6,231.3 110.1,263.9 127.4,226 "/&gt;
      &lt;/svg&gt;
  </code></pre>
  
  <p>And for  elements this approach isn't good too.
  It seems that I must find the biggest rectangle inside the svg shape and inside this rectangle place my text, scaled to rectangle dimensions. 
  Any idea how to do it? </p>
  
  <p>Path object from android.graphics package doesn't provide any method to find real center of the shape.</p>