IDWriteTextAnalyzer1::JustifyGlyphAdvances method

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

Syntax


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

Parameters

lineWidth

Type: FLOAT

The line width.

glyphCount

Type: UINT32

The glyph count.

justificationOpportunities [in]

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.

glyphAdvances [in]

Type: const FLOAT*

An array of glyph advances.

glyphOffsets [in]

Type: const DWRITE_GLYPH_OFFSET*

An array of glyph offsets.

justifiedGlyphAdvances [out]

Type: FLOAT*

The returned array of justified glyph advances.

justifiedGlyphOffsets [out, optional]

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

Minimum supported client

Windows 8 and Platform Update for Windows 7 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps | Windows Store apps]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Header

Dwrite_1.h

Library

Dwrite_1.lib

DLL

Dwrite_1.dll

See also

IDWriteTextAnalyzer1
IDWriteTextAnalyzer1::GetJustificationOpportunities

 

 

Community Additions

ADD
Show:
© 2014 Microsoft