TextRenderer
Vue de l’ensemble
‘TextRenderer’ est une classe dans Aspose.Font FOSS pour Python.
Il décline le texte en utilisant les métrics glyphes d’une lettre et les paires de noyaux facultatifs.
Cette classe fournit 5 méthodes pour travailler avec les objets TextRenderer dans les programmes Python. Les méthodologies disponibles comprennent: layout, Layoun_glyphs , render_png et render-rgb. Tous les membres publics sont accessibles à n’importe quelle application Pythone après l’installation de l’Aspose.Font FOSS pour le package PyThone.
méthodes
| Signature | Description |
|---|---|
layout(font: Font, text: str, size: float, kern: bool) → TextLayout | Resolve text to GlyphIds then call layout_glyphs. |
layout_glyphs(font: Font, glyph_ids: list[GlyphId], size: float, kern: bool) → TextLayout | Lay out pre-resolved glyph IDs. |
| `render_rgb(font: Font, text: str, size: float, color: tuple[int, int, int], background: tuple[int, int, int], padding: int, antialias: bool, _fixed_canvas: tuple[int, int] | None, _fixed_baseline: float |
render_png(font: Font, text: str, size: float, color: tuple[int, int, int], background: tuple[int, int, int], padding: int, antialias: bool) → bytes | Render single-line text to PNG bytes via software rasterization. |
render_svg(font: Font, text: str, size: float, color: tuple[int, int, int], background: tuple[int, int, int], padding: int) → bytes | Render single-line text to SVG bytes using vector outlines. |
Voir aussi
- Aspose.Font — référence API d’entreprise