IDWriteFontFace1::GetUnicodeRanges method

Retrieves a list of character ranges supported by a font.

Syntax


virtual HRESULT GetUnicodeRanges(
  UINT32 maxRangeCount,
  [out, optional]  DWRITE_UNICODE_RANGE *unicodeRanges,
  [out]            UINT32 *actualRangeCount
) = 0;

Parameters

maxRangeCount

Type: UINT32

Maximum number of character ranges passed in from the client.

unicodeRanges [out, optional]

Type: DWRITE_UNICODE_RANGE*

An array of DWRITE_UNICODE_RANGE structures that are filled with the character ranges.

actualRangeCount [out]

Type: UINT32*

A pointer to the actual number of character ranges, regardless of the maximum count.

Return value

Type: HRESULT

This method can return one of these values.

Return valueDescription
S_OK

The method executed successfully.

E_NOT_SUFFICIENT_BUFFER

The buffer is too small. The actualRangeCount was more than the maxRangeCount.

 

Remarks

A list of character ranges supported by the font is useful for scenarios like character picking, glyph display, and efficient font selection lookup. This is similar to GDI's GetFontUnicodeRanges, except that it returns the full Unicode range, not just 16-bit UCS-2.

These ranges are from the cmap, not the OS/2::ulCodePageRange1.

If this method is unavailable, you can use the IDWriteFontFace::GetGlyphIndices method to check for missing glyphs. The method returns the 0 index for glyphs that aren't present in the font.

The IDWriteFont::HasCharacter method is often simpler in cases where you need to check a single character or a series of single characters in succession, such as in font fallback.

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

IDWriteFontFace1

 

 

Community Additions

ADD
Show:
© 2014 Microsoft