Windows apps
Collapse the table of content
Expand the table of content
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.

IDWriteFontFace::GetGlyphIndices method

Returns the nominal mapping of UCS4 Unicode code points to glyph indices as defined by the font 'CMAP' table.


virtual HRESULT GetGlyphIndices(
  [in]  const UINT32 * codePoints,
              UINT32  codePointCount,
  [out]       UINT16 * glyphIndices
) = 0;


codePoints [in]

Type: const UINT32*

An array of USC4 code points from which to obtain nominal glyph indices. The array must be allocated and be able to contain the number of elements specified by codePointCount.


Type: UINT32

The number of elements in the codePoints array.

glyphIndices [out]

Type: UINT16*

When this method returns, contains a pointer to an array of nominal glyph indices filled by this function.

Return value


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


Note that this mapping is primarily provided for line layout engines built on top of the physical font API. Because of OpenType glyph substitution and line layout character substitution, the nominal conversion does not always correspond to how a Unicode string will map to glyph indices when rendering using a particular font face. Also, note that Unicode variant selectors provide for alternate mappings for character to glyph. This call will always return the default variant.

When characters are not present in the font this method returns the index 0, which is the undefined glyph or ".notdef" glyph. If a character isn't in a font, IDWriteFont::HasCharacter returns false and GetUnicodeRanges doesn't return it in the range.


Minimum supported client

Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps | Windows Store apps]

Minimum supported phone

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







See also




© 2017 Microsoft