TrueTypeFont

概述

TrueTypeFont 是 Aspose.Page FOSS 中用于 Python 的类。

TrueTypeFont 提供低层次的字形度量,例如前进宽度、垂直前进和轮廓点,以实现精确的文本布局。

该类提供 12 个方法,用于在 Python 程序中处理 TrueTypeFont 对象。可用的方法包括:__init__、glyph_advance、glyph_id_for_code、glyph_outline、glyph_sideways_advance、glyph_top_origin_x、glyph_top_origin_y_and_descender、glyph_vertical_advance、glyph_vertical_metrics、glyph_y_max、line_spacing_units、typo_ascender_units。在安装了 Aspose.Page FOSS for Python 包之后,所有公共成员对任何 Python 应用程序均可访问。属性:units_per_em。

属性

名称类型访问描述
units_per_em``读取获取每个 em 的单位数。

方法

签名描述
__init__(data: bytes)
glyph_id_for_code(code: int) → int
glyph_advance(glyph_id: int) → float
glyph_vertical_advance(glyph_id: int) → `floatNone`
line_spacing_units() → float
typo_ascender_units() → float
glyph_top_origin_x(glyph_id: int) → float
glyph_top_origin_y_and_descender(glyph_id: int) → tuple[float, float]
glyph_sideways_advance(glyph_id: int) → float
glyph_vertical_metrics(glyph_id: int) → `tuple[float, float]None`
glyph_y_max(glyph_id: int) → `intNone`
glyph_outline(glyph_id: int) → list[list[GlyphPoint]]

另请参阅

 中文