Type1Font

概述

Type1Font 是 Aspose.Font FOSS 中用于 Python 的类。继承自:Font。

Type1Font.load_afm 从给定路径加载 AFM 文件到 Type1Font 实例中。

此类提供 15 个方法,用于在 Python 程序中处理 Type1Font 对象。可用的方法包括:__init__、convert、encoding、font_family、font_name、font_style、font_type、get_kern_pairs、glyph_accessor、load_afm、metrics、num_glyphs,以及另外 3 个方法。所有公共成员在安装 Aspose.Font FOSS for Python 包后,可供任何 Python 应用程序访问。属性:encoding、font_family、font_name、font_style、font_type、glyph_accessor,以及另外 2 项。

属性

名称类型访问描述
font_typeFontType读取获取字体类型。
font_namestr读取获取字体名称。
font_familystr读取获取字体系列。
font_stylestr读取获取字体样式。
num_glyphsint读取获取字形数量。
metricsFontMetrics读取获取度量。
encodingFontEncoding读取获取编码。
glyph_accessorGlyphAccessor读取获取字形访问器。

方法

签名描述
__init__(raw_data: bytes, font_data: Type1FontData, is_pfa: bool)Calls init 在此 Type1Font 实例上。
get_kern_pairs() → list[KernPair]返回 kern pairs。
load_afm(path: str)从给定路径加载 AFM 文件到 Type1Font 实例中。
`to_bytes(font_type: FontTypeNone)→bytes`
font_type() → FontType返回标识字体格式的 FontType 枚举值
font_name() → str在此 Type1Font 实例上调用 font_name。
font_family() → str属性存储字体的族名称
font_style() → str返回字体的样式描述符(例如,Bold,Italic)
num_glyphs() → int属性提供字体中字形的总计数
metrics() → FontMetrics属性提供对字体的 FontMetrics 对象的访问
encoding() → FontEncoding返回一个描述字体字符编码的 FontEncoding 对象
glyph_accessor() → GlyphAccessor返回一个用于从字体检索字形数据的 GlyphAccessor
save(path: str)将字体写入指定的文件路径,使用其当前格式
save_to_format(font_type: FontType, path: str)在提供的路径处保存已转换为给定 FontType 的字体
convert(target: FontType) → Font对该 Type1Font 实例调用 convert。

另请参阅

 中文