poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Beeker <kiwiwi...@apache.org>
Subject Re: POI PPT XSLFTextParagraph know the point of text overflow.
Date Wed, 24 Apr 2019 20:35:46 GMT
> I checked XSLFTextShape.getTextHeight() to get text height ...
> Problem is I am not able to figure out the point of text
> overflow.

I know about the inaccuracy of the getTextHeight(graphics2d) method, which varies from Windows/Linux/Mac
system and the way Java vs. Windows-GDI renders fonts. You can test the height calculation
of various RTF stylings by rendering the PNG via PPTX2PNG and check it against the output
of Powerpoint.

If the result satisfies you *), then you are able to figure out of the point of text overflow,
which occurs when getTextHeight() is longer than your original textbox ...
what exactly confuses you when you compare those two values?

*) If the result doesn't satisfy you, then you need to dig into the SL Common drawing classes,
and optimize the text rendering to your runtime environment and used fonts, which you probably
don't know beforehand ...

Andi



Mime
View raw message