EotFont
概述
EotFont 是 Aspose.Font FOSS 中用于 Python 的类。继承自:Font。
嵌入式 OpenType(EOT)包装器,基于内部的 TrueType/OpenType 字体。
此类提供 6 个方法,用于在 Python 程序中处理 EotFont 对象。可用的方法包括:__init__、convert、get_kern_pairs、save、save_to_format、to_bytes。在安装了 Aspose.Font FOSS for Python 包后,所有公共成员对任何 Python 应用程序均可访问。属性:charset、encoding、eot_version、flags、font_family、font_name,以及另外 9 项。
属性
| 名称 | 类型 | 访问 | 描述 |
|---|---|---|---|
font_type | FontType | 读取 | 获取字体类型。 |
inner_font | TtfFont | 读取 | 获取内部字体。 |
font_name | str | 读取 | 获取字体名称。 |
font_family | str | 读取 | 获取字体族。 |
font_style | str | 读取 | 获取字体样式。 |
num_glyphs | int | 读取 | 获取字形的数量。 |
metrics | FontMetrics | 读取 | 获取度量。 |
encoding | FontEncoding | 读取 | 获取编码。 |
glyph_accessor | GlyphAccessor | 读取 | 获取字形访问器。 |
eot_version | int | 读取 | 获取 eot 版本。 |
flags | int | 读取 | 获取标志。 |
charset | int | 读取 | 获取字符集。 |
italic | int | 读取 | 获取斜体。 |
weight | int | 读取 | 获取权重。 |
fs_type | int | 读取 | 获取 fs 类型。 |
方法
| 签名 | 描述 |
|---|---|
__init__(inner: TtfFont, eot_version: int, flags: int, charset: int, italic: int, weight: int, fs_type: int) | 为内部 sfnt 字体创建一个 EOT 包装器。 |
get_kern_pairs() → list[KernPair] | 返回字距对。 |
| `to_bytes(font_type: FontType | None)→bytes` |
save(path: str) | 将 EOT 字体写入文件系统的指定路径 |
save_to_format(font_type: FontType, path: str) | 将字体转换为给定的 FontType 并保存到该路径 |
convert(target: FontType) → Font | 创建并返回一个指定目标 FontType 的新 Font 对象 |