跳转至

9.1 概述

General

PDF中用于处理文本的特殊功能—特别是代表字符的字形来自字体。字形是一个图形形状,并且受所有图形操作的影响,例如坐标变换。由于文本在大多数页面描述中的重要性,PDF提供了更高级的功能来方便和高效地描述、选择和渲染字形。

第一个子条款是对如何在页面上绘制字形的一般描述。随后的子条款详细涵盖了这些主题:

  • 文本状态(Text state)。图形状态参数的一个子集与文本有关,包括选择字体的参数、将字形缩放到适当大小的参数以及实现其他图形效果的参数。
  • 文本对象和操作符(Text objects and operators)。文本操作符指定要绘制的字形,由字符串对象表示,其值应解释为字符代码序列。一个文本对象包含一系列文本操作符和相关参数。
  • 字体数据结构(Font data structures)。字体字典和相关数据结构提供了符合规范的阅读器需要解释文本并正确定位字形的信息。字形本身的定义包含在字体程序中,这些程序可以嵌入在PDF文件中、内置于符合规范的阅读器中,或者从外部字体文件中获取。

This clause describes the special facilities in PDF for dealing with text—specifically, for representing characters with glyphs from fonts. A glyph is a graphical shape and is subject to all graphical manipulations, such as coordinate transformation. Because of the importance of text in most page descriptions, PDF provides higher- level facilities to describe, select, and render glyphs conveniently and efficiently.

The first sub-clause is a general description of how glyphs from fonts are painted on the page. Subsequent sub-clauses cover these topics in detail:

  • Text state. A subset of the graphics state parameters pertain to text, including parameters that select the font, scale the glyphs to an appropriate size, and accomplish other graphical effects.
  • Text objects and operators. The text operators specify the glyphs to be painted, represented by string objects whose values shall be interpreted as sequences of character codes. A text object encloses a sequence of text operators and associated parameters.
  • Font data structures. Font dictionaries and associated data structures provide information that a conforming reader needs to interpret the text and position the glyphs properly. The definitions of the glyphs themselves shall be contained in font programs, which may be embedded in the PDF file, built into a conforming reader, or obtained from an external font file.