IDWriteTextAnalyzer::GetGdiCompatibleGlyphPlacements method (dwrite.h)

Place glyphs output from the GetGlyphs method according to the font and the writing system's rendering rules.

Syntax

HRESULT GetGdiCompatibleGlyphPlacements(
  [in]           WCHAR const                           *textString,
  [in]           UINT16 const                          *clusterMap,
  [in]           DWRITE_SHAPING_TEXT_PROPERTIES        *textProps,
                 UINT32                                textLength,
  [in]           UINT16 const                          *glyphIndices,
  [in]           DWRITE_SHAPING_GLYPH_PROPERTIES const *glyphProps,
                 UINT32                                glyphCount,
  [in]           IDWriteFontFace                       *fontFace,
                 FLOAT                                 fontEmSize,
                 FLOAT                                 pixelsPerDip,
  [in, optional] DWRITE_MATRIX const                   *transform,
                 BOOL                                  useGdiNatural,
                 BOOL                                  isSideways,
                 BOOL                                  isRightToLeft,
  [in]           DWRITE_SCRIPT_ANALYSIS const          *scriptAnalysis,
  [in, optional] WCHAR const                           *localeName,
  [in, optional] DWRITE_TYPOGRAPHIC_FEATURES const     **features,
  [in, optional] UINT32 const                          *featureRangeLengths,
                 UINT32                                featureRanges,
  [out]          FLOAT                                 *glyphAdvances,
  [out]          DWRITE_GLYPH_OFFSET                   *glyphOffsets
);

Parameters

[in] textString

Type: const WCHAR*

An array of characters containing the original string from which the glyphs came.

[in] clusterMap

Type: const UINT16*

A pointer to the mapping from character ranges to glyph ranges. This is returned by GetGlyphs.

[in] textProps

Type: DWRITE_SHAPING_TEXT_PROPERTIES*

A pointer to an array of structures that contains shaping properties for each character. This structure is returned by GetGlyphs.

textLength

Type: UINT32

The text length of textString.

[in] glyphIndices

Type: const UINT16*

An array of glyph indices returned by GetGlyphs.

[in] glyphProps

Type: const DWRITE_SHAPING_GLYPH_PROPERTIES*

A pointer to an array of structures that contain shaping properties for each glyph returned by GetGlyphs.

glyphCount

Type: UINT32

The number of glyphs returned from GetGlyphs.

[in] fontFace

Type: IDWriteFontFace*

A pointer to the font face that is the source for the output glyphs.

fontEmSize

Type: FLOAT

The logical font size in DIPs.

pixelsPerDip

Type: FLOAT

The number of physical pixels per DIP.

[in, optional] transform

Type: const DWRITE_MATRIX*

An 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 set to FALSE, the metrics are the same as the metrics of GDI aliased text. When set to TRUE, the metrics are the same as the metrics of text measured by GDI using a font created with CLEARTYPE_NATURAL_QUALITY.

isSideways

Type: BOOL

A Boolean flag set to TRUE if the text is intended to be drawn vertically.

isRightToLeft

Type: BOOL

A Boolean flag set to TRUE for right-to-left text.

[in] scriptAnalysis

Type: const DWRITE_SCRIPT_ANALYSIS*

A pointer to a Script analysis result from anAnalyzeScript call.

[in, optional] localeName

Type: const WCHAR*

An array of characters containing the locale to use when selecting glyphs. For example, the same character may map to different glyphs for ja-jp versus zh-chs. If this is NULL, then the default mapping based on the script is used.

[in, optional] features

Type: const DWRITE_TYPOGRAPHIC_FEATURES**

An array of pointers to the sets of typographic features to use in each feature range.

[in, optional] featureRangeLengths

Type: const UINT32*

The length of each feature range, in characters.
The sum of all lengths should be equal to textLength.

featureRanges

Type: UINT32

The number of feature ranges.

[out] glyphAdvances

Type: FLOAT*

When this method returns, contains the advance width of each glyph.

[out] glyphOffsets

Type: DWRITE_GLYPH_OFFSET*

When this method returns, contains the offset of the origin of each glyph.

Return value

Type: HRESULT

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

Requirements

Requirement Value
Target Platform Windows
Header dwrite.h
Library Dwrite.lib
DLL Dwrite.dll

See also

IDWriteTextAnalyzer