IDWriteTextAnalyzer1::GetTextComplexity method (dwrite_1.h)

Determines the complexity of text, and whether you need to call IDWriteTextAnalyzer::GetGlyphs for full script shaping.

Syntax

HRESULT GetTextComplexity(
  [in]            WCHAR const     *textString,
                  UINT32          textLength,
                  IDWriteFontFace *fontFace,
  [out]           BOOL            *isTextSimple,
  [out]           UINT32          *textLengthRead,
  [out, optional] UINT16          *glyphIndices
);

Parameters

[in] textString

Type: const WCHAR*

The text to check for complexity. This string may be UTF-16, but any supplementary characters will be considered complex.

textLength

Type: UINT32

Length of the text to check.

fontFace

Type: IDWriteFontFace*

The font face to read.

[out] isTextSimple

Type: BOOL*

If true, the text is simple, and the glyphIndices array will already have the nominal glyphs for you. Otherwise, you need to call IDWriteTextAnalyzer::GetGlyphs to properly shape complex scripts and OpenType features.

[out] textLengthRead

Type: UINT32*

The length read of the text run with the same complexity, simple or complex. You may call again from that point onward.

[out, optional] glyphIndices

Type: UINT16*

Optional glyph indices for the text. If the function returned that the text was simple, you already have the glyphs you need. Otherwise the glyph indices are not meaningful, and you need to call IDWriteTextAnalyzer::GetGlyphs for shaping instead.

Return value

Type: HRESULT

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

Remarks

Text is not simple if the characters are part of a script that has complex shaping requirements, require bidi analysis, combine with other characters, reside in the supplementary planes, or have glyphs that participate in standard OpenType features. The length returned will not split combining marks from their base characters.

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.lib
DLL Dwrite.dll

See also

IDWriteTextAnalyzer1

IDWriteTextAnalyzer::GetGlyphs