Skip to content
Advertisement

Changing font for part of text in python-pptx

I’m using the python-pptx module to create presentations. How can I change the font properties only for a part of the text?

I currently change the font like this:

JavaScript

Thanks!

Advertisement

Answer

In PowerPoint, font properties are applied to a run. In a way, it is what defines a run; a “run” of text sharing the same font treatment, including typeface, size, color, bold/italic, etc.

So to make two bits of text look differently, you need to make them separate runs.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement