IDWriteFontFace2::GetRecommendedRenderingMode method (dwrite_2.h)

Determines the recommended text rendering and grid-fit mode to be used based on the font, size, world transform, and measuring mode.

Syntax

HRESULT GetRecommendedRenderingMode(
  [in]           FLOAT                    fontEmSize,
  [in]           FLOAT                    dpiX,
  [in]           FLOAT                    dpiY,
  [in, optional] DWRITE_MATRIX const      *transform,
  [in]           BOOL                     isSideways,
  [in]           DWRITE_OUTLINE_THRESHOLD outlineThreshold,
  [in]           DWRITE_MEASURING_MODE    measuringMode,
  [in, optional] IDWriteRenderingParams   *renderingParams,
  [out]          DWRITE_RENDERING_MODE    *renderingMode,
  [out]          DWRITE_GRID_FIT_MODE     *gridFitMode
);

Parameters

[in] fontEmSize

Type: FLOAT

Logical font size in DIPs.

[in] dpiX

Type: FLOAT

Number of pixels per logical inch in the horizontal direction.

[in] dpiY

Type: FLOAT

Number of pixels per logical inch in the vertical direction.

[in, optional] transform

Type: const DWRITE_MATRIX*

A DWRITE_MATRIX structure that describes the world transform.

[in] isSideways

Type: BOOL

Specifies whether the font is sideways. TRUE if the font is sideways; otherwise, FALSE.

[in] outlineThreshold

Type: DWRITE_OUTLINE_THRESHOLD

A DWRITE_OUTLINE_THRESHOLD-typed value that specifies the quality of the graphics system's outline rendering, affects the size threshold above which outline rendering is used.

[in] measuringMode

Type: DWRITE_MEASURING_MODE

A DWRITE_MEASURING_MODE-typed value that specifies the method used to measure during text layout. For proper glyph spacing, this method returns a rendering mode that is compatible with the specified measuring mode.

[in, optional] renderingParams

Type: IDWriteRenderingParams*

A pointer to a IDWriteRenderingParams interface for the rendering parameters object. This parameter is necessary in case the rendering parameters object overrides the rendering mode.

[out] renderingMode

Type: DWRITE_RENDERING_MODE*

A pointer to a variable that receives a DWRITE_RENDERING_MODE-typed value for the recommended rendering mode.

[out] gridFitMode

Type: DWRITE_GRID_FIT_MODE*

A pointer to a variable that receives a DWRITE_GRID_FIT_MODE-typed value for the recommended grid-fit mode.

Return value

Type: HRESULT

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

Requirements

Requirement Value
Minimum supported client Windows 8.1 [desktop apps only]
Minimum supported server Windows Server 2012 R2 [desktop apps only]
Target Platform Windows
Header dwrite_2.h
Library Dwrite.lib
DLL Dwrite.dll

See also

IDWriteFontFace2