Type1Font
概述
Type1Font 是 Aspose.Font FOSS 中用于 Python 的类。继承自:Font。
Type1Font.load_afm 从给定路径加载 AFM 文件到 Type1Font 实例中。
此类提供 15 个方法,用于在 Python 程序中处理 Type1Font 对象。可用的方法包括:__init__、convert、encoding、font_family、font_name、font_style、font_type、get_kern_pairs、glyph_accessor、load_afm、metrics、num_glyphs,以及另外 3 个方法。所有公共成员在安装 Aspose.Font FOSS for Python 包后,可供任何 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 | 读取 | 获取字形访问器。 |
方法
| 签名 | 描述 |
|---|---|
__init__(raw_data: bytes, font_data: Type1FontData, is_pfa: bool) | Calls init 在此 Type1Font 实例上。 |
get_kern_pairs() → list[KernPair] | 返回 kern pairs。 |
load_afm(path: str) | 从给定路径加载 AFM 文件到 Type1Font 实例中。 |
| `to_bytes(font_type: FontType | None)→bytes` |
font_type() → FontType | 返回标识字体格式的 FontType 枚举值 |
font_name() → str | 在此 Type1Font 实例上调用 font_name。 |
font_family() → str | 属性存储字体的族名称 |
font_style() → str | 返回字体的样式描述符(例如,Bold,Italic) |
num_glyphs() → int | 属性提供字体中字形的总计数 |
metrics() → FontMetrics | 属性提供对字体的 FontMetrics 对象的访问 |
encoding() → FontEncoding | 返回一个描述字体字符编码的 FontEncoding 对象 |
glyph_accessor() → GlyphAccessor | 返回一个用于从字体检索字形数据的 GlyphAccessor |
save(path: str) | 将字体写入指定的文件路径,使用其当前格式 |
save_to_format(font_type: FontType, path: str) | 在提供的路径处保存已转换为给定 FontType 的字体 |
convert(target: FontType) → Font | 对该 Type1Font 实例调用 convert。 |