IDWriteTextRenderer::DrawGlyphRun method (dwrite.h)

IDWriteTextLayout::Draw calls this function to instruct the client to render a run of glyphs.

Syntax

HRESULT DrawGlyphRun(
       void                               *clientDrawingContext,
       FLOAT                              baselineOriginX,
       FLOAT                              baselineOriginY,
       DWRITE_MEASURING_MODE              measuringMode,
  [in] DWRITE_GLYPH_RUN const             *glyphRun,
  [in] DWRITE_GLYPH_RUN_DESCRIPTION const *glyphRunDescription,
       IUnknown                           *clientDrawingEffect
);

Parameters

clientDrawingContext

Type: void*

The application-defined drawing context passed to IDWriteTextLayout::Draw.

baselineOriginX

Type: FLOAT

The pixel location (X-coordinate) at the baseline origin of the glyph run.

baselineOriginY

Type: FLOAT

The pixel location (Y-coordinate) at the baseline origin of the glyph run.

measuringMode

Type: DWRITE_MEASURING_MODE

The measuring method for glyphs in the run, used with the other properties to determine the rendering mode.

[in] glyphRun

Type: const DWRITE_GLYPH_RUN*

Pointer to the glyph run instance to render.

[in] glyphRunDescription

Type: const DWRITE_GLYPH_RUN_DESCRIPTION*

A pointer to the glyph run description instance which contains properties of the characters associated with this run.

clientDrawingEffect

Type: IUnknown*

Application-defined drawing effects for the glyphs to render. Usually this argument represents effects such as the foreground brush filling the interior of text.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The IDWriteTextLayout::Draw function calls this callback function with all the information about glyphs to render. The application implements this callback by mostly delegating the call to the underlying platform's graphics API such as Direct2D to draw glyphs on the drawing context. An application that uses GDI can implement this callback in terms of the IDWriteBitmapRenderTarget::DrawGlyphRun method.

Requirements

Requirement Value
Minimum supported client Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header dwrite.h
Library Dwrite.lib
DLL Dwrite.dll

See also

IDWriteTextRenderer