title: Detect where Android's TextView would insert a line break
body: <p>I have a rectangular tile, and I want to fit an image and some text into it. The image must not overlap the text, and the sizes of the image and the text can vary.</p>
  
  <p>The process <strong>must</strong> be hand-coded, since we have to fine-tune it according to our client's needs.</p>
  
  <p>I tried the approach of first measuring the rendered text bounds using <code>getTextBounds()</code> or <code>measureText()</code> and then adapting the font size and the image size so they don't overlap.</p>
  
  <p>This works fine if the text is only on one line.</p>
  
  <p>But if <code>TextView</code> wraps the text onto multiple line, I cannot predict the text bounds, since I don't know where <code>TextView</code> would insert the automatic line breaks.</p>
  
  <p><strong>How can I find out the positions in the text where <code>TextView</code> inserts an automatic line break?</strong></p>
  
  <p><strong>Example:</strong> Given the text</p>
  
  <p><code>Lorem ipsum dolor sit amet</code></p>
  
  <p>which would be rendered as</p>
  
  <pre><code>| Lorem ipsum    |
  | dolor sit amet |
  </code></pre>
  
  <p>I need a function that converts</p>
  
  <p><code>Lorem ipsum dolor sit amet</code></p>
  
  <p>to</p>
  
  <p><code>Lorem ipsum \ndolor sit amet</code></p>