Get the inline style for the shape element. Args: style_args (StyleArg): The style arguments for HTML conversion. Returns: str: The inline style string.
(self, style_args: StyleArg)
| 412 | return s |
| 413 | |
| 414 | def get_inline_style(self, style_args: StyleArg): |
| 415 | """ |
| 416 | Get the inline style for the shape element. |
| 417 | |
| 418 | Args: |
| 419 | style_args (StyleArg): The style arguments for HTML conversion. |
| 420 | |
| 421 | Returns: |
| 422 | str: The inline style string. |
| 423 | """ |
| 424 | id_str = f" id='{self.shape_idx}'" if style_args.element_id else "" |
| 425 | styles = [] |
| 426 | if style_args.area: |
| 427 | styles.append(f"data-relative-area={self.area*100/self.slide_area:.2f}%;") |
| 428 | if style_args.size: |
| 429 | styles.append(f"width: {self.width}pt; height: {self.height}pt;") |
| 430 | if style_args.geometry: |
| 431 | styles.append(f"left: {self.left}pt; top: {self.top}pt;") |
| 432 | if style_args.font_style and self.text_frame.is_textframe: |
| 433 | font_style = get_font_style(self.text_frame.font) |
| 434 | if font_style: |
| 435 | styles.append(font_style) |
| 436 | if len(styles) != 0: |
| 437 | return id_str + " style='" + " ".join(styles) + "'" |
| 438 | return id_str |
| 439 | |
| 440 | |
| 441 | class UnsupportedShape(ShapeElement): |