Fitting Text into a Shape

The library never automatically changes the bounds of a shape as text is added/edited. The following method is provided so you can set the final size of a shape after the text has been edited (if required).

This method returns the shape bounds that will optimally fit all the text that the shape contains. It takes into account all of the relevant properties e.g. word wrap, text orientation, font type etc.

To get the optimal bounds to fix the text within a shape use:

java.awt.Rectangle getBoundsToFitText()

Setting the bounds of the shape using this method follows the behaviour of PowerPoint's Resize AutoShape to Fit Text property. See Size, Position and Rotation in the Working with Shapes and Groups chapter (earlier in this Guide) for more about setting the bounds of shapes.


Page generated: 2008-01-18 02:53:28 GMT TonicPoint Builder Developer's Guide -- Version 2.3