CffOutlines
CffOutlines
概述
CffOutlines 是 Aspose.PDF FOSS 中用于 Python 的一个类。
从 CFF(Type 2 charstring)字体程序中解码字形轮廓。
此类提供 4 种方法,用于在 Python 程序中处理 CffOutlines 对象。可用的方法包括:__init__、advance_width、encoding_code_to_gid、outline。在安装 Aspose.PDF FOSS for Python 包后,所有公共成员对任何 Python 应用程序均可访问。属性:num_glyphs、ok、units_per_em。
属性
| 名称 | 类型 | 访问 | 描述 |
|---|---|---|---|
ok | bool | 读取 | True 当 CFF 程序成功解析时。 |
units_per_em | `` | 读取 | 获取每个 em 的单位。 |
num_glyphs | `` | 读取 | 获取字形的数量。 |
方法
| 签名 | 描述 |
|---|---|
__init__(font_bytes: bytes) | Calls init(font_bytes) 在此 CffOutlines 实例上。 |
outline(gid: int) → list[Contour] | 返回已展平且闭合的轮廓,用于 gid 以字体单位(y 向上)。 |
advance_width(gid: int) → `int | None` |
encoding_code_to_gid() → dict[int, int] | 返回 CFF 内置的自定义编码为 code -> gid,或 {}。 |