thebeancounter
thebeancounter

Reputation: 4839

Python 2.7 pptx textframe autofit size

I need to fit a text frame to the exact size to be centered above the center of an image, the issue is that when i give it a width and a left value, when the text does not fill it, it's getting smaller, same when it's smaller than the text demands,

I tried to use auto fit but this is not what i need

And tried to change the width, height values but it behaves according to the actual text size.

I need some way to center the text box around a certain left value for it to be around the middle of the slide.

Thanks

Upvotes: 1

Views: 400

Answers (1)

scanny
scanny

Reputation: 28893

A reliable way to center text like this is to make the text box the same width as the picture (and aligned with it), and then set the text alignment (justification) of the text paragraph to center.

The resulting text box is often wider than strictly necessary to show the text, but PowerPoint does the alignment for you and very reliably.

Upvotes: 2

Related Questions