3.1.1.6.3 Drawing Text
To draw text, the server MUST first create rasterizations of the glyph bitmaps for all glyphs to be drawn and MUST then populate the glyph cache with these glyph bitmaps by using a sequence as specified in 2.2.7.65. Next, the server MUST create a glyph run resource that contains an array of glyph bitmap indices and reference that glyph run resource from a glyph run rendering instruction. Finally, the server MUST add at least one realization to the glyph.
Realization: A description that indicates the font face set that has to be used for a specific scale. Realizations are a collection of bitmaps that contain rasterizations for every font character used. A realization is maintained for every font and font size. Bitmaps are added to the realization on first use. Subsequent uses from other glyphs exploit the same realization entry. See figureĀ for an example of a glyph run with two realizations.
When it is time to render a glyph run, the composition engine calculates the scale at which it needs to be rendered and chooses from the realization list the font face that best matches that scale. The combination of font face and glyph index is then used to address the specific glyph bitmap to be used for each glyph. FigureĀ depicts a glyph run with two realizations that index glyph bitmaps in two font face sets that are rasterized for two different scales.

Figure 5: Example glyph run with two realizations
To prepare a glyph run for rendering with a specified font at two different scales (as shown in the previous figure), the following steps MUST be performed:
Rasterize glyph bitmaps for the glyphs in the glyph run at scale Sc1.
Allocate a font face handle Ffs1 for text that is rendered with scale Sc1.
Allocate indices for the glyphs that are rasterized in step 1, and add the glyph bitmaps to the glyph cache that addresses them with (Ffs1, glyph index) pairs.
Rasterize glyph bitmaps for the glyphs in the glyph run at scale Sc2.
Allocate a new font face handle Ffs2 for the text that is rendered with scale Sc2.
Add the bitmaps that are rasterized for scale Sc2 to the cache using the new font face handle and the same indices as used for Fsf1.
Create a glyph run that contains the glyph indices that are allocated for the required text.
Add two realizations to the newly created glyph run. The realizations are described by (scale, font face id) pairs, in this example (Sc1, Ffs1) and (Sc2, Ffs2).