IDWriteTextAnalyzer1::ApplyCharacterSpacing method (dwrite_1.h)

Applies spacing between characters, properly adjusting glyph clusters and diacritics.

Syntax

HRESULT ApplyCharacterSpacing(
        FLOAT                                 leadingSpacing,
        FLOAT                                 trailingSpacing,
        FLOAT                                 minimumAdvanceWidth,
        UINT32                                textLength,
        UINT32                                glyphCount,
  [in]  UINT16 const                          *clusterMap,
  [in]  FLOAT const                           *glyphAdvances,
  [in]  DWRITE_GLYPH_OFFSET const             *glyphOffsets,
  [in]  DWRITE_SHAPING_GLYPH_PROPERTIES const *glyphProperties,
  [out] FLOAT                                 *modifiedGlyphAdvances,
  [out] DWRITE_GLYPH_OFFSET                   *modifiedGlyphOffsets
);

Parameters

leadingSpacing

The spacing before each character, in reading order.

trailingSpacing

The spacing after each character, in reading order.

minimumAdvanceWidth

The minimum advance of each character, to prevent characters from becoming too thin or zero-width. This must be zero or greater.

textLength

The length of the clustermap and original text.

glyphCount

The number of glyphs.

[in] clusterMap

Mapping from character ranges to glyph ranges.

[in] glyphAdvances

The advance width of each glyph.

[in] glyphOffsets

The offset of the origin of each glyph.

[in] glyphProperties

Properties of each glyph, from GetGlyphs.

[out] modifiedGlyphAdvances

The new advance width of each glyph.

[out] modifiedGlyphOffsets

The new offset of the origin of each glyph.

Return value

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

Remarks

The input and output advances/offsets are allowed to alias the same array.

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