TextFont

概述

TextFont 是 Aspose.PDF FOSS 中用于 TypeScript 的一个类。

此类在 TypeScript 程序中为 TextFont 对象声明了 6 个方法。可用的方法包括:constructor、decode、decodeGlyphs、decodeRun、encode、encodeChar。在安装了针对 TypeScript 的 Aspose.PDF FOSS 包后,所有公共成员对任何 TypeScript 应用程序均可访问。属性:bold、canEncode、cid、code、codeWidth、italic,以及另外 4 项。

属性

名称类型访问描述
codeWidth: number读取此字体允许的最窄字符码(单位为字节):普通字体为 1,Identity-H 和大多数复合字体为 2。
wmode`: 01`读取
name: string读取字体的 /BaseFont 名称(保留子集前缀),如果不存在则为 undefined。
bold: boolean读取当文档声明此字体为粗体/斜体时为 True。
italic: boolean读取获取斜体。
type3: Type3Data读取针对 Type 3 字体的集合:其字形过程以及它们绘制的空间。
code: number读取获取代码。
cid: number读取获取 cid。
len: number读取获取长度。
canEncodeboolean读取获取 can encode。

方法

签名描述
constructor(dict: PdfDict, resolve: Resolve, inflate: Inflate)在此 TextFont 实例上调用构造函数 constructor(dict, resolve, inflate)。
decodeRun(bytes: Uint8Array) → RunMetrics将字节解码为文本并附加运行的前进度量。
decode(bytes: Uint8Array) → string将 show-string 的字节解码为 Unicode 文本。
encodeChar(ch: string) → `numberundefined`
encode(text: string) → Uint8Array将 text 编码为此字体编码中的显示字符串字节。
decodeGlyphs(bytes: Uint8Array) → Glyph[]将字节解码为每个字符代码的记录(位置,em 宽度)。
 中文