TextRenderer
概要
TextRenderer は Aspose.Font FOSS の Python 用クラスです。
フォントのグリフメトリックとオプションの kern ペアを使用してテキストを配置します。
このクラスは、Python プログラムにおける TextRenderer オブジェクトを操作するための 5 つのメソッドを提供します。利用可能なメソッドは、layout、layout_glyphs、render_png、render_rgb、render_svg です。Aspose.Font の Python 用 FOSS パッケージをインストールすれば、すべての公開メンバーは任意の Python アプリケーションからアクセス可能です。
メソッド
| シグネチャ | 説明 |
|---|---|
layout(font: Font, text: str, size: float, kern: bool) → TextLayout | テキストを GlyphIds に解決し、次に layout_glyphs を呼び出します。 |
layout_glyphs(font: Font, glyph_ids: list[GlyphId], size: float, kern: bool) → TextLayout | 事前に解決されたグリフ ID を配置します。 |
| `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 | ソフトウェアラスタライズを使用して、単一行テキストを PNG バイト列にレンダリングします。 |
render_svg(font: Font, text: str, size: float, color: tuple[int, int, int], background: tuple[int, int, int], padding: int) → bytes | ベクトルアウトラインを使用して、単一行テキストを SVG バイトにレンダリングします。 |