Type1Outlines
Type1Outlines
概述
Type1Outlines 是 Aspose.PDF FOSS 中用于 Python 的一个类。
从 Type 1(/FontFile)字体程序中解码字形轮廓。
此类提供 3 种方法,用于在 Python 程序中处理 Type1Outlines 对象。可用的方法包括:__init__、advance_width、outline。在安装了 Aspose.PDF FOSS for Python 包之后,所有公共成员对任何 Python 应用程序均可访问。属性:builtin_encoding、glyph_names、name_to_gid、num_glyphs、ok、units_per_em。
属性
| 名称 | 类型 | 访问 | 描述 |
|---|---|---|---|
ok | bool | 读取 | True 当解析带有字符串的 Type 1 程序时。 |
units_per_em | `` | 读取 | 获取每 em 的单位数。 |
num_glyphs | `` | 读取 | 获取 num glyphs。 |
glyph_names | list[str] | 读取 | 获取字形名称。 |
name_to_gid | dict[str, int] | 读取 | 获取名称到 gid。 |
builtin_encoding | dict[int, str] | 读取 | 获取内置编码。 |
方法
| 签名 | 描述 |
|---|---|
| `init(font_bytes: bytes, length1: int | None, length2: int |
outline(gid: int) → list[Contour] | 返回已展平、闭合的轮廓用于 gid 以字体单位(y 向上)。 |
advance_width(gid: int) → `int | None` |