Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IDWriteTextAnalyzer1::GetJustifiedGlyphs method

Fills in new glyphs for complex scripts where justification increased the advances of glyphs, such as Arabic with kashida.

Syntax


virtual HRESULT GetJustifiedGlyphs(
                        IDWriteFontFace                 *fontFace,
                        FLOAT                           fontEmSize,
                        DWRITE_SCRIPT_ANALYSIS          scriptAnalysis,
                        UINT32                          textLength,
                        UINT32                          glyphCount,
                        UINT32                          maxGlyphCount,
  [in, optional]  const UINT16                          *clusterMap,
  [in]            const UINT16                          *glyphIndices,
  [in]            const FLOAT                           *glyphAdvances,
  [in]            const FLOAT                           *justifiedGlyphAdvances,
  [in]            const DWRITE_GLYPH_OFFSET             *justifiedGlyphOffsets,
  [in]            const DWRITE_SHAPING_GLYPH_PROPERTIES *glyphProperties,
  [out]                 UINT32                          *actualGlyphCount,
  [out, optional]       UINT16                          *modifiedClusterMap,
  [out]                 UINT16                          *modifiedGlyphIndices,
  [out]                 FLOAT                           *modifiedGlyphAdvances,
  [out]                 DWRITE_GLYPH_OFFSET             *modifiedGlyphOffsets
) = 0;

Parameters

fontFace

Type: IDWriteFontFace*

Font face used for shaping.

May be NULL.

fontEmSize

Type: FLOAT

Font em size used for the glyph run.

scriptAnalysis

Type: DWRITE_SCRIPT_ANALYSIS

Script of the text from the itemizer.

textLength

Type: UINT32

Length of the text.

glyphCount

Type: UINT32

Number of glyphs.

maxGlyphCount

Type: UINT32

Maximum number of output glyphs allocated by caller.

clusterMap [in, optional]

Type: const UINT16*

Clustermap produced from shaping.

glyphIndices [in]

Type: const UINT16*

Original glyphs produced from shaping.

glyphAdvances [in]

Type: const FLOAT*

Original glyph advances produced from shaping.

justifiedGlyphAdvances [in]

Type: const FLOAT*

Justified glyph advances from IDWriteTextAnalyzer1::JustifyGlyphAdvances.

justifiedGlyphOffsets [in]

Type: const DWRITE_GLYPH_OFFSET*

Justified glyph offsets from IDWriteTextAnalyzer1::JustifyGlyphAdvances.

glyphProperties [in]

Type: const DWRITE_SHAPING_GLYPH_PROPERTIES*

Properties of each glyph, from IDWriteTextAnalyzer::GetGlyphs.

actualGlyphCount [out]

Type: UINT32*

The new glyph count written to the modified arrays, or the needed glyph count if the size is not large enough.

modifiedClusterMap [out, optional]

Type: UINT16*

Updated clustermap.

modifiedGlyphIndices [out]

Type: UINT16*

Updated glyphs with new glyphs inserted where needed.

modifiedGlyphAdvances [out]

Type: FLOAT*

Updated glyph advances.

modifiedGlyphOffsets [out]

Type: DWRITE_GLYPH_OFFSET*

Updated glyph offsets.

Return value

Type: HRESULT

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

Remarks

You call GetJustifiedGlyphs after the line has been justified, and it is per-run.

You should call GetJustifiedGlyphs if IDWriteTextAnalyzer1::GetScriptProperties returns a non-null DWRITE_SCRIPT_PROPERTIES.justificationCharacter for that script.

Use GetJustifiedGlyphs mainly for cursive scripts like Arabic. If maxGlyphCount is not large enough, GetJustifiedGlyphs returns the error E_NOT_SUFFICIENT_BUFFER and fills the variable to which actualGlyphCount points with the needed glyph count.

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.lib

DLL

Dwrite.dll

See also

IDWriteTextAnalyzer::GetGlyphs
IDWriteTextAnalyzer1
IDWriteTextAnalyzer1::GetScriptProperties
IDWriteTextAnalyzer1::JustifyGlyphAdvances

 

 

Show:
© 2017 Microsoft