title: resizeToFitText() leads to text overflowing textbox with non-Latin characters
body: <p>We're using Apache POI 3.16 (latest version at the time of writing).</p>
  
  <p>Our code looks like this:</p>
  
  <pre><code>XSLFTextBox textBox = slide.createTextBox();
  XSLFTextParagraph paragraph = textBox.getTextParagraphs().get(0);
  XSLFTextRun textRun = paragraph.addNewTextRun();
  textRun.setText("non-Latin characters here");
  textBox.setAnchor(new Rectangle(left, top, width, 10000));
  textBox.resizeToFitText();
  </code></pre>
  
  <p>Note that we are not changing the font style in any way.</p>
  
  <p>This code results in the text overflowing the textbox:</p>
  
  <p><a href="https://i.stack.imgur.com/CHePI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CHePI.png" alt="Text overflowing textbox with Apache POI"></a></p>
  
  <p>It does not appear to be an Apache POI bug. I could find only two issues about <code>resizeToFitText()</code> (<a href="https://bz.apache.org/bugzilla/show_bug.cgi?id=45140" rel="nofollow noreferrer">Bug 45140</a>, <a href="https://bz.apache.org/bugzilla/show_bug.cgi?id=47594" rel="nofollow noreferrer">Bug 47594</a>) and both are related to newline characters (<a href="https://bz.apache.org/bugzilla/show_bug.cgi?id=45140" rel="nofollow noreferrer">which is another problem we're encountering</a>).</p>
  
  <p>Any idea on how we could circumvent the problem?</p>
  
  <p>UPDATE 1: Here is a complete, standalone repro case:</p>
  
  <pre><code>import java.awt.Rectangle;
  import java.io.FileOutputStream;
  
  import org.apache.poi.xslf.usermodel.XMLSlideShow;
  import org.apache.poi.xslf.usermodel.XSLFSlide;
  import org.apache.poi.xslf.usermodel.XSLFTextBox;
  import org.apache.poi.xslf.usermodel.XSLFTextParagraph;
  import org.apache.poi.xslf.usermodel.XSLFTextRun;
  
  public class TextBoxOverflow {
      public static void main(String[] args) throws Exception {
  
          XMLSlideShow slideShow = new XMLSlideShow();
  
          XSLFSlide slide = slideShow.createSlide();
  
          XSLFTextBox textBox = slide.createTextBox();
          XSLFTextParagraph paragraph = textBox.getTextParagraphs().get(0);
          XSLFTextRun textRun = paragraph.addNewTextRun();
          textRun.setText(
              "ちょっと早いけどTシャツが着たくなる季節♡お母さんの影響か、非常に恐竜が大好きです。もう飼いたいくらい大好きです。#ジュラシックワールド のラプトル4姉妹とか激的に可愛くて可愛くて可愛くて可愛いです。めろめろ、大好き♡お母さんも恐竜が好きで、小さい頃、古代生物の図鑑を一緒に見てたの思い出す〜とい");
          textBox.setAnchor(new Rectangle(50, 50, 200, 5000));
          textBox.resizeToFitText();
  
          FileOutputStream out = new FileOutputStream("TextBoxOverflow.pptx");
          slideShow.write(out);
          out.close();
          slideShow.close();
      }
  }
  </code></pre>
  
  <p>and the result:</p>
  
  <p><a href="https://i.stack.imgur.com/Y8m1K.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Y8m1K.png" alt="Text overflowing textbox with Apache POI"></a></p>
  
  <p>UPDATE 2: Bug logged in Apache POI's bug tracker:<br>
  <a href="https://bz.apache.org/bugzilla/show_bug.cgi?id=61169" rel="nofollow noreferrer">https://bz.apache.org/bugzilla/show_bug.cgi?id=61169</a></p>