WoffFont
概述
WoffFont 是 Aspose.Font FOSS 中用于 Python 的一个类。继承自:Font。
WoffFont.font_type 返回此 WOFF 字体的 FontType 枚举值。
此类提供 14 个方法,用于在 Python 程序中处理 WoffFont 对象。可用的方法包括:__init__、convert、encoding、font_family、font_name、font_style、font_type、get_kern_pairs、glyph_accessor、metrics、num_glyphs、save,以及另外 2 个方法。安装 Aspose.Font FOSS for Python 包后,所有公共成员对任何 Python 应用程序均可访问。属性:encoding、font_family、font_name、font_style、font_type、glyph_accessor,以及另外 4 项。
属性
| 名称 | 类型 | 访问 | 描述 |
|---|---|---|---|
font_type | FontType | 读取 | 获取字体类型。 |
font_name | str | 读取 | 获取字体名称。 |
font_family | str | 读取 | 获取字体族。 |
font_style | str | 读取 | 获取字体样式。 |
num_glyphs | int | 读取 | 获取字形数量。 |
metrics | FontMetrics | 读取 | 获取度量。 |
encoding | FontEncoding | 读取 | 获取编码。 |
glyph_accessor | GlyphAccessor | 读取 | 获取字形访问器。 |
metadata_xml | str | 读取 | 获取元数据 xml。 |
inner_font | TtfFont | 读取 | 获取内部字体。 |
方法
| 签名 | 描述 |
|---|---|
__init__(inner: TtfFont, metadata_xml: str) | Calls init 在此 WoffFont 实例上。 |
get_kern_pairs() → list[KernPair] | 返回字距对。 |
| `to_bytes(font_type: FontType | None)→bytes` |
font_type() → FontType | 返回此 WOFF 字体的 FontType 枚举值 |
font_name() → str | 属性提供字体的名称字符串 |
font_family() → str | 属性提供字体的族名字符串 |
font_style() → str | 在此 WoffFont 实例上调用 font_style。 |
num_glyphs() → int | 属性返回字体中字形的数量 |
metrics() → FontMetrics | 属性返回字体的 FontMetrics 对象 |
encoding() → FontEncoding | 在此 WoffFont 实例上调用 encoding。 |
glyph_accessor() → GlyphAccessor | 返回一个用于检索字形信息的GlyphAccessor |
save(path: str) | 在此WoffFont实例上调用 save。 |
save_to_format(font_type: FontType, path: str) | 在此WoffFont实例上调用 save_to_format。 |
convert(target: FontType) → Font | 在此WoffFont实例上调用 convert。 |