apache / apache/poi

Text is not correctly rendered on Shapes

Open
#853 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.3k
Forks
844
Avg merge
5h 52m
Merged PRs (30d)
47

Description

**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

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in org.apache.poi.sl.draw.DrawTextParagraph, specifically getWrappingWidth(boolean firstLine, Graphics2D graphics). Review how indents and margins are subtracted, then account for PowerPoint’s implicit margin based on half the border line width. Done means rendered line breaks match PowerPoint and text no longer overlaps the border in JPG/PNG exports.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.