(self)
| 412 | return f"<img src=\"data:image/png;base64, {png_b64}\" />" |
| 413 | |
| 414 | def _repr_png_(self) -> bytes: |
| 415 | from matplotlib.figure import Figure # Circular import. |
| 416 | fig = Figure() |
| 417 | font_path = Path(self.fname) if self.fname != '' else None |
| 418 | fig.text(0, 0, self.name, font=font_path) |
| 419 | with BytesIO() as buf: |
| 420 | fig.savefig(buf, bbox_inches='tight', transparent=True) |
| 421 | return buf.getvalue() |
| 422 | |
| 423 | |
| 424 | def ttfFontProperty(font): |