IDWriteFontFace1::GetGdiCompatibleGlyphAdvances method (dwrite_1.h)

Returns the pixel-aligned advances for a sequences of glyphs.

Syntax

HRESULT GetGdiCompatibleGlyphAdvances(
                 FLOAT               emSize,
                 FLOAT               pixelsPerDip,
  [in, optional] DWRITE_MATRIX const *transform,
                 BOOL                useGdiNatural,
                 BOOL                isSideways,
                 UINT32              glyphCount,
  [in]           UINT16 const        *glyphIndices,
  [out]          INT32               *glyphAdvances
);

Parameters

emSize

Type: FLOAT

Logical size of the font in DIP units. A DIP ("device-independent pixel") equals 1/96 inch.

pixelsPerDip

Type: FLOAT

Number of physical pixels per DIP. For example, if the DPI of the rendering surface is 96 this value is 1.0f. If the DPI is 120, this value is 120.0f/96.

[in, optional] transform

Type: const DWRITE_MATRIX*

Optional transform applied to the glyphs and their positions. This transform is applied after the scaling specified by the font size and pixelsPerDip.

useGdiNatural

Type: BOOL

When FALSE, the metrics are the same as GDI aliased text (DWRITE_MEASURING_MODE_GDI_CLASSIC). When TRUE, the metrics are the same as those measured by GDI using a font using CLEARTYPE_NATURAL_QUALITY (DWRITE_MEASURING_MODE_GDI_NATURAL).

isSideways

Type: BOOL

Retrieve the glyph's vertical advances rather than horizontal advances.

glyphCount

Type: UINT32

Total glyphs to retrieve adjustments for.

[in] glyphIndices

Type: const UINT16*

An array of glyph id's to retrieve advances.

[out] glyphAdvances

Type: const INT32*

The returned advances in font design units for each glyph.

Return value

Type: HRESULT

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

Remarks

This is equivalent to calling GetGdiCompatibleGlyphMetrics and using only the advance width and height.

Like GetGdiCompatibleGlyphMetrics, these are in design units, meaning they must be scaled down by DWRITE_FONT_METRICS::designUnitsPerEm.

Requirements

Requirement Value
Minimum supported client Windows 8 and Platform Update for Windows 7 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps | UWP apps]
Target Platform Windows
Header dwrite_1.h
Library Dwrite_1.lib
DLL Dwrite_1.dll

See also

IDWriteFontFace1