TextRenderer

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 バイトにレンダリングします。

参照

 日本語