IDWritePaintReader::SetCurrentGlyph(UINT32,DWRITE_PAINT_ELEMENT*,D2D_RECT_F*,DWRITE_PAINT_ATTRIBUTES*) method (dwrite_3.h)

Sets the current glyph, and positions the reader on the root paint element of the selected glyph's visual tree. This method is an inline overload of SetCurrentGlyph, in which structSize is implied.

Syntax

HRESULT SetCurrentGlyph(
  UINT32                  glyphIndex,
  DWRITE_PAINT_ELEMENT    *paintElement,
  D2D_RECT_F              *clipBox,
  DWRITE_PAINT_ATTRIBUTES *glyphAttributes
);

Parameters

glyphIndex

Type: UINT32

Glyph index to get the color glyph representation for.

paintElement

Type: _Out_writes_bytes_(structSize) DWRITE_PAINT_ELEMENT *

Receives information about the root paint element of the glyph's visual tree.

clipBox

Type: _Out_ D2D_RECT_F *

Receives a precomputed glyph box (in ems) for the specified glyph, if one is specified by the font. Otherwise, the glyph box is set to an empty rectangle (all zeros). If a non-empty clip box is specified, then you must clip the color glyph's representation to the specified box.

glyphAttributes

Type: _Out_opt_ DWRITE_PAINT_ATTRIBUTES * = nullptr

Receives optional paint attributes for the glyph.

Return value

A standard HRESULT error code.

Remarks

If the specified glyph index isn't a color glyph, then the method succeeds, but the paintType member of the DWRITE_PAINT_ELEMENT structure is set to DWRITE_PAINT_TYPE_NONE. In that case, you should draw the input glyph as a non-color glyph.

Requirements

Requirement Value
Minimum supported client Windows 10, version 1809 (with Windows App SDK 1.2 or later)
Header dwrite_3.h