python-pptx icon indicating copy to clipboard operation
python-pptx copied to clipboard

Fit shape to text?

Open Rapid1898-code opened this issue 1 year ago • 1 comments

Hello - is there any way to fit a shape to a text?

(so i have a simply text-field in a shape with a background color - and when the text is too long it gets cut - so i want to autosize the shape to the given text)

I tried it with

shape.text_frame.fit_text()

but this seems to only shrink the text itself - but i want to have the shape get fitted to the text.

Rapid1898-code avatar Apr 25 '24 07:04 Rapid1898-code

fit_text is experimental and this will not be fixed in python-pptx. See here: https://github.com/scanny/python-pptx/issues/982

mszbot avatar Sep 13 '24 14:09 mszbot