Character Text and the Indexed Font Architecture

The process of imaging character text is intimately bound to the font architecture. The font architecture used in this International Standard is defined in ISO/IEC 9541, Information processing: Font information interchange. The model for character text and Indexed Fonts is established in this Clause. The Indexed Font architecture defined herein augments the ISO/IEC 9541 font architecture to optimize the presentation of text as specified in this International Standard.

The architecture for Indexed Fonts and character text is comprised of several models. The ISO/IEC 9541 font model and Font Resources are described in ; the model for glyphs and glyph sequences is described in . The Indexed Font model, which is described in , augments a Font Resource with a method for glyph identification. These models are abstract models used to define the semantics of the text and Indexed Font operators. Except where explicit, visible data structures are specified, the implementation need only mimic the behavior of these models; it need not implement them exactly. The precise effect produced if a font whose attributes and structure are specified in ISO/IEC 9541 is used with an SPDL document for the imaging of character text is defined by the data structures and operators defined in , , and .

Fonts

The font model used in this International Standard is that established in ISO/IEC 9541, Information processing: Font information interchange.

An (abstract) font is a collection of shapes having the same basic design, for example,. Garamond Italic, together with information about these shapes both individually and collectively. These shapes represent identified graphical symbols, called glyphs, which may be used for the presentation of information in human readable form. The glyph is an abstract shape which is independent of any of the particular shapes used to represent it. A glyph representation combines a shape representation with metric attributes, such as positioning information. The shape representation is expressed in some description language. The presentation of a shape representation places a glyph image on the presentation medium. The glyph image is a visible instance of the glyph.

Font Resources

Using the terminology of ISO/IEC 9541, a font is represented by a Font Resource. The effects of the presentation of character text using a particular font is specified in terms of a Font Resource which represents the font.

A Font Resource consists of a collection of glyph representations together with descriptive information and font metrics which are relevant to the collection of glyph representations as a whole. The glyph representations consist of shape information together with attributes associated with each of the individual glyphs. Each glyph representation consists of a glyph shape, which is a description of a shape which represents the glyph, and glyph metrics, which specify the dimensions and positioning of the glyph shape. Glyph representations in a Font Resource are identified by glyph identifiers. In ISO/IEC 9541, glyph identifiers are Structured Names (see ). These Structured Names are converted to values of type Identifier before the Content Processor is called (see ). Although fonts used in existing implementations are in general not defined according to ISO/IEC 9541, the attributes of these fonts which are used in the presentation of character text are basically equivalent to attributes specified in ISO/IEC 9541. It would therefore be possible to produce font resources whose structure and attributes are as defined in ISO/IEC 9541 which would produce the same results when used for the presentation of character text. The presentation of character text in documents using fonts other than those defined according to ISO/IEC 9541 is to be understood in terms of logically equivalent fonts defined by Font Resources whose structure and attributes do conform to ISO/IEC 9541.

Font Size, scaling and rotation

The glyph attributes which are used in the presentation of character text are defined in a Glyph Coordinate System whose units are proportional to the nominal body size of the font. In addition, glyph shapes are graphical objects, either geometric or raster. They are, therefore, subject to all of the graphical manipulations provided by the application of coordinate transformations. For example, a glyph shape, presented using a particular font, may be scaled over a range of sizes, and may be rotated for use in portrait mode, landscape mode, or any other orientation with respect to the medium.

Since presented text is simply the sequence of glyph images that result from presenting a sequence of glyph shapes, each of which can be transformed, an entire strings of text can be scaled and rotated by altering the CurrentTransformation in effect at the time that it is imaged.

Bold and italic text

A particular Font Resource has only a single set of (scalable, rotatable) glyph shapes. The glyph shapes for the presentation of bold or italic character text are obtained by the selection of distinct Font Resources which contain these glyph shapes.

Writing modes

The presentation of multi-national text often requires that the glyph shapes represented in a Font Resource be usable in a variety of writing modes. These writing modes include left-to-right writing, top-to-bottom writing, and right-to-left writing. A single Font Resource (used in a single size and orientation) may be used to present text in different writing modes.

Although there is only one set of glyph shapes represented in a Font Resource, there may be multiple sets of the glyph metric attributes, one set for each of several writing modes. The writing mode dependent attributes which are of significance to this International Standard are the positioning point coordinates (ISO9541/PX and ISO9541/PY) and the escapement point coordinates (ISO9541/EX and ISO9541/EY). Although the coordinates of the bounding box for the glyph shape, ISO9541/MAXFONTEXT, are also repeated for each writing mode, the coordinate values must always be the same because they are given minimum and maximum extents of the shape within the glyph coordinate system and this does not vary with writing mode.

Glyphs, Glyph Mappings and Indexed Fonts

Glyph identifiers

The combination of a Font Resource and a glyph identifier uniquely specify a glyph representation. When this glyph representation is imaged the result is a glyph image that is added to the page image.

The choice of the glyph representations which are to be used to present an element of character text is the responsibility of the Composition and Layout Process. The presentation of each glyph image is completely defined by selecting a font and using the glyph identifier that corresponds to the glyph representation to select the glyph shape and glyph metrics within that font. This International Standard provides several ways to represent the choices of glyph representations that have been made by a Composition and Layout Process. One representation allows the glyph identifier for a chosen glyph representation to be specified directly. Another representation is optimized for representing a sequence of choices of glyph representations.

Strings

In the presentation of character text, it is common to have a sequence of glyphs, all from the same font, to be presented, one after another. This International Standard provides the GlyphString type, which is a representation for a sequence of one or more choices of glyph representations.

GlyphStrings are OctetStringReferences. The sequence of octets in the referenced OctetString is used to derive a sequence of Cardinals. These Cardinals are used to identify the glyph representations to be presented. The algorithms for deriving the Cardinals and for using them to identify glyph representations are specified in and . The text of this International Standard will refer to "the octets in a GlyphString" with the understanding that this means the octets in the OctetString referenced by the GlyphString.

Indices

Glyph indices

Glyph indices are Cardinals which are used to determine a glyph identifier directly (see ) and thereby access a glyph shape.

Composite Fonts and Font indices

In languages with ideographic glyphs, the collection of glyphs may be quite large. This International Standard provides for combining a collection of smaller fonts into a hierarchical structure called a Composite Font (see ). When the current font is such a Composite Font, then some of the Cardinals provided by GlyphStrings are associated with, and specify, component fonts of the Composite Font. These Cardinals are called font indices. Fonts without any hierarchical structure are called Base Fonts (see ).

Indexed Fonts

In this International Standard, the ISO/IEC 9541 concept of Font Resource is extended. An Indexed Font is a combination of a Font Resource and a Glyph Mapping. An IndexedFont is a value of type IndexedFont (see ).

Glyph Mappings

A Glyph Mapping is a mapping of Cardinals which may be glyph or font indices to glyph identifiers in the case of glyph indices and to Cardinals, which are used as font selectors, in the case of font indices. This mapping is comprised of both a data structure, the Encoding Vector, and an algorithm. This mapping is specified in Structure as a GLYPH INDEX MAP SPECIFICATION if the result is a Base Font and as part of a COMPOSITE FONT SPECIFICATION if the result is a Composite Font.

The mapping algorithm specifies the algorithm for interpreting the octets in a GlyphString as glyph indices if the font is a Base Font, and glyph and font indices if the font is a Composite Font. The Encoding Vector for a Base Font specifies the association of glyph identifiers with the glyph indices. In the case of a Composite Font, the Encoding Vector specifies the association of component IndexedFonts with font indices. GLYPH INDEX MAPS are represented by Glyph Index Encoding Vectors and FONT INDEX MAPS are represented in Content as Font Index Encoding Vectors.

Specific Glyph Mappings and their application to GlyphStrings are defined in and .

  • When a GlyphStrings is imaged, it is in the context of a particular font with a particular Glyph Mapping. The font and mapping used to image the GlyphString is established by the value of the Graphics State Variable CurrentFont when the imaging operator which takes the OctetStringReference as an operand is interpreted. The method by which GlyphStrings are presented is defined in , and
  • It is important to emphasize that this International Standard specifies only the effect to be achieved, and not the mechanism which must be used to produce that result. Although the definitions of this clause are based on the identification of the glyph representations in the Font Resource by glyph identifiers and the explicit mapping of glyph indices to glyph identifiers, it is likely that actual implementations will organize the glyph representations and font information internally in such a way that this mapping is optimized. In addition, many of the fonts which will be used in the presentation of SPDL documents will never exist in interchange format, and will have an assumed Glyph Mapping embedded in their internal representation. The use of such fonts is conforming so long as the effects defined by this International Standard are achieved.

    Indexed Fonts

    In this International Standard, Indexed Fonts may be specified in Structure and/or constructed in Content. An Indexed Font is specified in Structure and placed in the environment either by a RESOURCE DEFINITION for a FONT SPECIFICATION (see and ) or it is placed in the environment by some process that is outside of the scope of this International Standard. Indexed Font Resources are made available to Content Processing via RESOURCE DECLARATIONS (see ) which put resources into the Set of Available Resources (see and . IndexedFonts may be constructed in Content as outlined in the following subclauses and detailed in and .

    Indexed Font Specification Dictionaries

    The Indexed Font Specification Dictionary is a data structure which represents the structure and attributes of an IndexedFont. The form of an Indexed Font Specification Dictionary is consistent with the content notation of this International Standard. The definition of the Indexed Font Specification Dictionary formally links the font attributes defined in ISO/IEC 9541 with this International Standard. It provides a representation of the Font Resource structure and attributes defined in ISO/IEC 9541 using SPDL object types. The semantics and attributes of the Font Resource portion of the Indexed Font Specification Dictionary are expressed in terms defined in ISO/IEC 9541.

    Any Font Resource whose structure and attributes conform to ISO/IEC 9541 can be represented by an SPDL Indexed Font Specification Dictionary. The two structures used to describe font attributes in ISO/IEC 9541 are Structured Names and property lists.

    Property lists are represented in SPDL by one of two object types:

    • an object of type Vector, which represents an ordered list of property values, or
    • an object of type Dictionary for which:
      • the keys of the key/value pairs in the Dictionary correspond to the Structured Names which identify the attributes in the ISO/IEC 9541 property list;
      • the values of the key/value pairs are the values of the attributes, which may themselves be DictionaryReferences, VectorReferences, or values such as numbers.

    ISO/IEC 9541 Structured Names are represented in SPDL Base Indexed Font Specification Dictionaries in one of three ways:

    • Some of the Structured Names used in ISO/IEC 9541 are abbreviated or modified within SPDL Indexed Font Specification Dictionaries, but their semantics are preserved. These are represented in SPDL by the Name data type.
    • other Structured Names are represented in SPDL by the Identifier data type. Such Identifiers are equivalent to the result of applying the ConvertToIdentifier operator to an OctetString which is the canonical string form of the public identifier which is semantically equivalent to the Structured Name as defined in ISO/IEC 9070.
    • ISO/IEC 9541 glyph identifiers that are registered according to ISO/IEC 10036 are represented in SPDL Font Dictionaries by Names of the form afiinnnn as described in .
    Most of the attributes specified as being in a Base Indexed Font Specification Dictionary are defined in ISO/IEC 9541 or are similar to attributes defined in ISO/IEC 9541. In addition, there are some attributes that are used in Base Indexed Font Specification Dictionaries that are defined by this International Standard; some examples are:
    • an initial Transformation, representing the size and orientation of the Glyph Coordinate System relative to the User Coordinate System, with the font at nominal unitary size (prior to any use of ScaleFont or TransformFont).
    • a default writing mode for the font.
    • a default Glyph Mapping, associating glyph indices with glyph identifiers (see 24.2.1.1).

    This International Standard specifies required attributes which must be present and optional attributes which may be present in an Indexed Font Specification Dictionary or in dictionaries it references. Other key/value pairs, either for other ISO/IEC 9541 attributes or for any other purpose, may occur in these dictionaries and shall be ignored by the Content Processor when using these dictionaries in imaging activities.

    A Indexed Font Specification Dictionary can be constructed by the interpretation of token sequences and used to create a IndexedFont which can then be used within a document for the presentation of character text.

    An Indexed Font Specification Dictionary is a Dictionary containing the key/value pair <FontType: Integer>, and additional required key/value pairs depending on the value associated with FontType.

    There are two categories of Indexed Font Specification Dictionary: Base Fonts are specified using Base Indexed Font Specification Dictionaries and Composite Fonts are specified using Composite Indexed Font Specification Dictionaries. From this point on, a Base Font will be an IndexedFont derived from a Base Indexed Font Specification Dictionary and a Composite Font will be an IndexedFont derived from a Composite Indexed Font Specification Dictionary.

    The definition of the character text operators requires the definition of two specialized data structures which are used for presentation of character text. These are Indexed Font Specification Dictionaries and IndexedFonts. defines Base Indexed Font Specification Dictionaries together with the mapping of glyph indices. defines Composite Indexed Font Specification Dictionaries together with the related mappings of font and glyph indices. This subclause provides an overview of both kinds of Indexed Font Specification Dictionaries.

    Base Indexed Font Specification Dictionaries

    The Base Indexed Font Specification Dictionary is the data structure which represents IndexedFonts that have no Hierarchical structure. It is the data structure which formally defines the properties of a Base Font. defines the following allowed values for FontType for Base Indexed Font Specification Dictionaries. The semantics for each type of Base Indexed Font Specification Dictionary is specified in . Typemeaning 3An Indexed Font Specification Dictionary with FontType 3 can be specified entirely in the SPDL content notation. The semantics of FontType 3 Indexed Font Specification Dictionaries underlie the semantics of all Base Fonts 1An Indexed Font Specification Dictionary with FontType 1 corresponds to a Base IndexedFont created using the Indexed Font Interchange Format defined in annex c. The semantics of FontType 1 Indexed Font Specification Dictionaries are defined in terms of FontType 3 Indexed Font Specification Dictionaries.

    Composite Indexed Font Specification Dictionaries

    Composite Fonts are Hierarchical data structures which provide for the combination of Base Fonts (and other Composite Fonts) into larger, composite fonts. Composite Fonts also provide for more complex Glyph Mappings than Base Fonts.

    The Composite Indexed Font Specification Dictionary is the data structure which formally defines the properties of a Composite Font (see ). The contents of a Composite Indexed Font Specification Dictionary are similar to those of a Base Indexed Font Specification Dictionary, but glyph shape information is specified via component fonts. defines the following allowed values for FontType for Composite Indexed Font Specification Dictionaries. The semantics for each type of Composite Indexed Font Specification Dictionary is specified in . Typemeaning 0An Indexed Font Specification Dictionary with FontType 0 corresponds to a Composite IndexedFont. The semantics of FontType 0 Indexed Font Specification Dictionaries define the semantics of all Composite Fonts.

    Indexed Fonts

    An IndexedFont is a value of type DictionaryReference, which refers to a Dictionary containing the information necessary for the actual process of presenting character text using a particular font. The IndexedFont may be an abstraction of the Indexed Font Specification Dictionary to which it corresponds. An Indexed Font Dictionary shall contain at least:

    • glyph shape information;
    • as many sets of glyph metrics (to be used in sequentially positioning glyph shapes from the Font Resource) as are needed to support the writing modes used;
    • a Transformation representing the relationship of the Glyph Coordinate System to the User Coordinate System, at the size and orientation at which the Font Resource is to be used;
    • the writing mode associated with the IndexedFont;
    • a Glyph Mapping association glyph indices with glyph identifiers and, in the case of a Composite Font, associating font indices with component IndexedFonts;

    IndexedFonts may be constructed by the DefineFont operator or selected from the repertoire available in the environment of the Presentation Process by the FindFont operator, or produced by operators which modify existing IndexedFonts.

  • There is a Font Installation Process outside of the scope of SPDL which accepts a Font Resource as defined for interchange by ISO/IEC 9541 and produces a data structure which can be used to construct a IndexedFont for use by SPDL processors. The function performed by this process is similar to that performed by the DefineFont operator, the major differences being that the Font Installation Process binds only a default Transformation and Glyph Mapping to the installed font, and that the Font Installation Process must retain sufficient attribute information associated with the installed font to enable the Presentation Process to select the installed font which best satisfied the font reference which is declared in the FONT REFERENCE FONT SPECIFICATION (see ).
  • The Glyph Mapping of a Base Font may be modified within the document in structure in the REMAPPED FONT SPECIFICATION, or in content by use of the OpenFont operator, the DefineFont operator, and operators that manipulate Dictionaries and Vectors. The Glyph Mapping of a Composite IndexedFont may not be modified in structure, except by the Font Installation Process; however, a Composite Font mapping may be generated in structure in a COMPOSITE FONT SPECIFICATION. In content, it can be manipulated using the corresponding Composite Indexed Font Specification Dictionary (if it is not closed) and the operators used with Base Fonts immediately above.
  • The definition of IndexedFonts and Indexed Font Specification Dictionaries in this clause and the next two clauses defines their logical structure and provides a basis for the definition, in a subsequent clause, of the effects of using fonts for the imaging of character text. There is no requirement that implementations actually store and access IndexedFonts by means of their associated Indexed Font Dictionaries; it is the intent of the International Standard to enable the effective application of optimization techniques in this area (hence, the provision of closed IndexedFont Dictionaries; see ). All that is required is that the effect of interpreting the character text and font operators be as defined.

    Indexed Font Dictionaries

    An Indexed Font Dictionary is a Dictionary which has its semantics defined entirely by reference to an Indexed Font Specification Dictionary. The value of the Graphics State Variable CurrentFont must be a DictionaryReference referencing a Indexed Font Dictionary. Thus, Indexed Font Dictionaries are the data structure actually used by the interpreter to image glyph representations on the presentation medium.

    A Indexed Font Dictionary is said to correspond to a Indexed Font Specification Dictionary containing equivalent metric, glyph shape, and Glyph Mapping information. The effect of using a IndexedFont in the presentation of character text is defined by the operators in this clause with reference to the Indexed Font Specification Dictionary to which it corresponds. This clause specifies only the results of using a properly constructed IndexedFont with an SPDL interpreter. The actual method by which these results are achieved by such an interpreter is implementation dependent.

    Indexed Font Dictionaries have the following properties:

    • Each Indexed Font Dictionary which has an access attribute of ReadOnly corresponds to a Indexed Font Specification Dictionary. When the DefineFont operator is applied to a IndexedFont. When the OpenFont operator is applied to a IndexedFont, the result is a corresponding Indexed Font Specification Dictionary Reference (unless the referenced Indexed Font Dictionary's access attribute is ExecuteOnly or NoAccess, see below).
    • All Indexed Font Dictionaries have an access attribute of at most ReadOnly. They may not be modified, but there are operators in that create a new Indexed Font which is a modification of an existing Indexed Font. In particular, the Put operator may not be used with Indexed Font Dictionaries. Such an attempt will result in an InvalidAccess exception.
    • Implementations may impose the following additional restriction: some or all Indexed Font Dictionary referenced by IndexedFonts may have an access attribute of ExecuteOnly or NoAccess, then it must contain sufficient information to reconstruct a corresponding Indexed Font Specification Dictionary when the OpenFont operator is applied. And if the Indexed Font Dictionary allows applying the Get operator, then the Indexed Font Dictionary shall have at least the keys that would be in the Indexed Font Specification Dictionary.

    Although the contents of a Indexed Font Dictionary with an access attribute of ExecuteOnly or NoAccess are unspecified, the semantics of a IndexedFont used for character text presentation is fully specified, in terms of the corresponding Indexed Font Specification Dictionary. - of the International Standard defines the semantics of Indexed Font Dictionaries as though they were identical in content and behavior to Indexed Font Specification Dictionaries, with the understanding that implementations may define the contents of Indexed Font Dictionaries in other ways. This means that any font technology can be used with the abstract process defined by this International Standard as long as there is a mapping of that technology into model defined by the Indexed Font Specification Dictionary, the Indexed Font Dictionary and the operators on them. relates this model to the properties of an ISO/IEC 9541 Font Resource.

    As part of this method of definition, the representation

  • {indexedfont /key Get} is used to represent the action of obtaining the information from the Indexed Font Dictionary referenced by indexedfont, corresponding to the information stored as the value of the key key in the corresponding Indexed Font Specification Dictionary, even though the Indexed Font Dictionary referenced by indexedfont may have an ExecuteOnly attribute, and may not have an explicit entry whose key is key. Likewise the notation
  • {indexedfont OpenFont} is used to represent the action of obtaining a modifiable copy of the Indexed Font Specification Dictionary corresponding to the Indexed Font Dictionary referenced by indexedfont, even though the Indexed Font Dictionary referenced by indexedfont may have an ExecuteOnly attribute, and therefore not be subject to the OpenFont operator. The above representations are a notational convenience only, since the Get and OpenFont operators cannot actually be used with some Indexed Font Dictionaries.