_Run
paper-pptx 0.2.0 API reference
Text run object. Corresponds to a:r child element in a paragraph.
_Run(r: CT_RegularTextRun, parent: ProvidesPart)Attributes
font
attributefontFont instance containing run-level character properties for the text in this run.
Character properties can be and perhaps most often are inherited from parent objects such as the paragraph and slide layout the run is contained in. Only those specifically overridden at the run level are contained in the font object.
hyperlink
attributehyperlink_HyperlinkProxy for any a:hlinkClick element under the run properties element.
Created on demand, the hyperlink object is available whether an a:hlinkClick element is
present or not, and creates or deletes that element as appropriate in response to actions
on its methods and attributes.
part
attributepartXmlPartThe package part containing this object.
text
attributetextRead/write. A unicode string containing the text in this run.
Assignment replaces all text in the run. The assigned value can be a 7-bit ASCII string, a UTF-8 encoded 8-bit string, or unicode. String values are converted to unicode assuming UTF-8 encoding.
Any other control characters in the assigned string other than tab or newline
are escaped as a hex representation. For example, ESC (ASCII 27) is escaped as
"x001B". Contrast the behavior of TextFrame.text and _Paragraph.text with
respect to line-feed and vertical-tab characters.
Functions
effective_font
funceffective_font()Return an EffectiveFont with this run's resolved size, name, and color.
paper-pptx addition: executes the documented inheritance walk (run -> paragraph ->
shape list style -> placeholder/layout/master styles -> presentation defaults ->
theme) and reports the provenance chain for each value. Read-only. See
pptx.inspect.effective_font.