Font
概要
Font は Aspose.Font の Python 用 FOSS のクラスです。継承元: ABC。
すべてのフォント形式実装のための抽象基底。
このクラスは、Python プログラムで Font オブジェクトを操作するための 5 つのメソッドを提供します。利用可能なメソッドは: convert, get_kern_pairs, save, save_to_format, to_bytes。Aspose.Font の Python 用 FOSS パッケージをインストールすれば、すべての公開メンバーは任意の Python アプリケーションからアクセス可能です。プロパティ: encoding, font_family, font_name, font_style, font_type, glyph_accessor、およびその他 2 つ。
プロパティ
| 名前 | 型 | アクセス | 説明 |
|---|---|---|---|
font_type | FontType | 読み取り | フォントタイプを取得します。 |
font_name | str | 読み取り | フォント名を取得します。 |
font_family | str | 読み取り | フォントファミリーを取得します。 |
font_style | str | 読み取り | フォントスタイルを取得します。 |
num_glyphs | int | 読み取り | グリフ数を取得します。 |
metrics | FontMetrics | 読み取り | メトリックを取得します。 |
encoding | FontEncoding | 読み取り | エンコーディングを取得します。 |
glyph_accessor | GlyphAccessor | 読み取り | glyph accessor を取得します。 |
メソッド
| シグネチャ | 説明 |
|---|---|
save(path: str) | 現在のフォントインスタンスを指定されたファイルシステムパスに書き込み、現在のフォーマットを保持します |
| `to_bytes(font_type: FontType | None)→bytes` |
save_to_format(font_type: FontType, path: str) | 指定されたパスに、与えられた FontType 形式でフォントを書き込みます |
get_kern_pairs() → list[KernPair] | このフォントのすべての kern ペアを返します。 |
convert(target: FontType) → Font | creates a newFontobject converted to the target format; conversion failures raiseFontConversionException` |