poi icon indicating copy to clipboard operation
poi copied to clipboard

Text is not correctly rendered on Shapes

Open sascha08-15 opened this issue 6 months ago • 0 comments

Current state

in org.apache.poi.sl.draw.DrawTextParagraph in method protected double getWrappingWidth(boolean firstLine, Graphics2D graphics)

  • Indents are correctly subtracted
  • Margins too
  • Line (the border) width is unaccounted for

Result:

  • line breaks are wrong/inconsistent with actual PowerPoint
  • Worst cases: text is rendered over the border (e.g. JPG/PNG export)

To be state

  • Powerpoint has an implicit margin which is 0.5 of the border line width
  • getWrappingWidth should account for the line width to get the actual canvas size it is drawing to

sascha08-15 avatar Jul 23 '25 06:07 sascha08-15