4.1.1.5 Example 5

In order to instruct a client to render a glyph and then insert the glyph into the Decompressor Glyph Storage (section 3.3.1.9) ADM element, the server encapsulates an encoded representation of the glyph within a CLEARCODEC_BITMAP_STREAM (section 2.2.4.1) structure. This structure is embedded within an RDPGFX_WIRE_TO_SURFACE_PDU_1 (section 2.2.2.1) message, which is transmitted to the client. Within the CLEARCODEC_BITMAP_STREAM structure, the CLEARCODEC_FLAG_GLYPH_INDEX (0x01) flag is present in the flags field, while the CLEARCODEC_FLAG_GLYPH_HIT (0x02) flag is absent. The glyph bitmap is present in the compositePayload field. Once decoded, the glyph is effectively a linear stream of pixels, as shown in the following diagram.

Sixteen glyph pixels stored in a linear stream with no implied dimensions

Figure 10: Sixteen glyph pixels stored in a linear stream with no implied dimensions

The width and height of the glyph is determined by the rectangle defined in the destRect field of the encapsulating RDPGFX_WIRE_TO_SURFACE_PDU_1 message. For example, assuming that the width is 2 pixels and the height is 8 pixels, the following image would be rendered by the client.

A 2 x 8 glyph

Figure 11: A 2 x 8 glyph

The decoded linear stream of pixels is stored within the Decompressor Glyph Storage ADM element in the slot specified by the glyphIndex field of the encapsulating CLEARCODEC_BITMAP_STREAM structure. The pixels are stored with no implied dimensions. For the sake of this example, assume that the assigned slot is Slot 4.

If the server detects a cache hit and determines that the glyph stored by the client in Slot 4 of the Decompressor Glyph Storage ADM element has to be rendered, the client will be sent a CLEARCODEC_BITMAP_STREAM structure (encapsulated within a RDPGFX_WIRE_TO_SURFACE_PDU_1 message) with the flags field containing both the CLEARCODEC_FLAG_GLYPH_INDEX and CLEARCODEC_FLAG_GLYPH_HIT flags. The optional compositePayload field will not be present. Note that in this case, the dimensions of the rectangle specified by the container RDPGFX_WIRE_TO_SURFACE_PDU_1 message (in the destRect field) can be any width and height that yields an effective area of 16 pixels2. For example, a possible configuration could be the following 4-pixel-by-4-pixel glyph.

A 4 x 4 glyph

Figure 12: A 4 x 4 glyph

Another possible configuration is the following 8-pixel-by-2-pixel glyph.

An 8 x 2 glyph

Figure 13: An 8 x 2 glyph

In effect, a linear stream of pixels stored in a slot in the Decompressor Glyph Storage ADM element can be blitted into a number of rectangular configurations, as long as all of the pixels are used in the configuration. The ultimate configuration is determined by cache hits encountered by the server encoder.