IDWriteTextAnalyzer1::JustifyGlyphAdvances method (dwrite_1.h)

Justifies an array of glyph advances to fit the line width.

Syntax

HRESULT JustifyGlyphAdvances(
                  FLOAT                                  lineWidth,
                  UINT32                                 glyphCount,
  [in]            DWRITE_JUSTIFICATION_OPPORTUNITY const *justificationOpportunities,
  [in]            FLOAT const                            *glyphAdvances,
  [in]            DWRITE_GLYPH_OFFSET const              *glyphOffsets,
  [out]           FLOAT                                  *justifiedGlyphAdvances,
  [out, optional] DWRITE_GLYPH_OFFSET                    *justifiedGlyphOffsets
);

Parameters

lineWidth

Type: FLOAT

The line width.

glyphCount

Type: UINT32

The glyph count.

[in] justificationOpportunities

Type: const DWRITE_JUSTIFICATION_OPPORTUNITY*

A pointer to a DWRITE_JUSTIFICATION_OPPORTUNITY structure that contains info for the allowed justification expansion/compression for each glyph. Get this info from IDWriteTextAnalyzer1::GetJustificationOpportunities.

[in] glyphAdvances

Type: const FLOAT*

An array of glyph advances.

[in] glyphOffsets

Type: const DWRITE_GLYPH_OFFSET*

An array of glyph offsets.

[out] justifiedGlyphAdvances

Type: FLOAT*

The returned array of justified glyph advances.

[out, optional] justifiedGlyphOffsets

Type: DWRITE_GLYPH_OFFSET*

The returned array of justified glyph offsets.

Return value

Type: HRESULT

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

Remarks

You call JustifyGlyphAdvances after you call IDWriteTextAnalyzer1::GetJustificationOpportunities to collect all the opportunities, and JustifyGlyphAdvances spans across the entire line. The input and output arrays are allowed to alias each other, permitting in-place update.

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

IDWriteTextAnalyzer1

IDWriteTextAnalyzer1::GetJustificationOpportunities