magnww commented on PR #505:
URL: https://github.com/apache/poi/pull/505#issuecomment-1720433400

   Test code: 
   ```
       @Test
       public void testResizeToFitText() throws IOException {
           XMLSlideShow slideShow = new XMLSlideShow();
           Slide slide = slideShow.createSlide();
           TextBox textBox = slide.createTextBox();
           textBox.setAnchor(new Rectangle(0, 0, 600, 100));
           TextRun textRun = 
textBox.appendText("测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试", false);
           textRun.setFontFamily("黑体");
           textRun.setFontSize(40.);
           textBox.resizeToFitText();
   
           Slide slide2 = slideShow.createSlide();
           TextBox textBox2 = slide2.createTextBox();
           textBox2.setAnchor(new Rectangle(0, 0, 600, 100));
           TextRun textRun2 = textBox2.appendText("latin character test latin 
character test latin character test latin character test latin character test 
latin character test latin character test latin test latin character test latin 
character test", false);
           textRun2.setFontFamily(HSSFFont.FONT_ARIAL);
           textRun2.setFontSize(40.);
           textBox2.resizeToFitText();
   
           try (FileOutputStream outputStream = new 
FileOutputStream("e:\\temp\\test.pptx")) {
               slideShow.write(outputStream);
           }
       }
   ```
   The Textbox height set by the `resizeToFitText` method is smaller than the 
actual height.
   
   
![图片](https://github.com/apache/poi/assets/7497333/25b28d94-c9c2-4eb5-8020-7d3953980b43)
   
   
![图片](https://github.com/apache/poi/assets/7497333/ddce7762-3b57-4222-b1d8-f48f707852e0)
   
   
   
   After adding getLeading:
   
   
![图片](https://github.com/apache/poi/assets/7497333/b72c3b28-b199-43f4-a492-2c57c024c461)
   
   
![图片](https://github.com/apache/poi/assets/7497333/6c22d3e0-c5ac-4698-a825-c437e57a61d6)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to