MCPcopy Create free account
hub / github.com/scanny/python-pptx / CT_TextSpacing

Class CT_TextSpacing

src/pptx/oxml/text.py:572–602  ·  view source on GitHub ↗

Used for `a:lnSpc`, `a:spcBef`, and `a:spcAft` elements.

Source from the content-addressed store, hash-verified

570
571
572class CT_TextSpacing(BaseOxmlElement):
573 """Used for `a:lnSpc`, `a:spcBef`, and `a:spcAft` elements."""
574
575 get_or_add_spcPct: Callable[[], CT_TextSpacingPercent]
576 get_or_add_spcPts: Callable[[], CT_TextSpacingPoint]
577 _remove_spcPct: Callable[[], None]
578 _remove_spcPts: Callable[[], None]
579
580 # this should actually be a OneAndOnlyOneChoice, but that's not
581 # implemented yet.
582 spcPct: CT_TextSpacingPercent | None = ZeroOrOne( # pyright: ignore[reportAssignmentType]
583 "a:spcPct"
584 )
585 spcPts: CT_TextSpacingPoint | None = ZeroOrOne( # pyright: ignore[reportAssignmentType]
586 "a:spcPts"
587 )
588
589 def set_spcPct(self, value: float):
590 """Set spacing to `value` lines, e.g. 1.75 lines.
591
592 A ./a:spcPts child is removed if present.
593 """
594 self._remove_spcPts()
595 spcPct = self.get_or_add_spcPct()
596 spcPct.val = value
597
598 def set_spcPts(self, value: Length):
599 """Set spacing to `value` points. A ./a:spcPct child is removed if present."""
600 self._remove_spcPct()
601 spcPts = self.get_or_add_spcPts()
602 spcPts.val = value
603
604
605class CT_TextSpacingPercent(BaseOxmlElement):

Callers

nothing calls this directly

Calls 1

ZeroOrOneClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…