Convert the text frame to PPTC format. Args: father_idx (int): The index of the parent shape. Returns: str: The PPTC representation of the text frame.
(self, father_idx: int)
| 159 | return len(self.text) |
| 160 | |
| 161 | def to_pptc(self, father_idx: int) -> str: |
| 162 | """ |
| 163 | Convert the text frame to PPTC format. |
| 164 | |
| 165 | Args: |
| 166 | father_idx (int): The index of the parent shape. |
| 167 | |
| 168 | Returns: |
| 169 | str: The PPTC representation of the text frame. |
| 170 | """ |
| 171 | if not self.is_textframe: |
| 172 | return "" |
| 173 | s = f"[Text id={father_idx}]" |
| 174 | for para in self.paragraphs: |
| 175 | if para.idx == -1: |
| 176 | continue |
| 177 | s += f"\n" |
| 178 | s += f"[Paragraph id={para.idx}]" |
| 179 | s += get_font_pptcstyle(para.font) + f"\n" |
| 180 | s += para.text + "\n" |
| 181 | return s |
| 182 | |
| 183 | |
| 184 | class ShapeElement: |
no test coverage detected