Used for `a:lnSpc`, `a:spcBef`, and `a:spcAft` elements.
| 570 | |
| 571 | |
| 572 | class 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 | |
| 605 | class CT_TextSpacingPercent(BaseOxmlElement): |
nothing calls this directly
no test coverage detected
searching dependent graphs…