IDWriteFontFallback::MapCharacters method (dwrite_2.h)

Determines an appropriate font to use to render the beginning range of text.

Syntax

HRESULT MapCharacters(
                 IDWriteTextAnalysisSource *analysisSource,
                 UINT32                    textPosition,
                 UINT32                    textLength,
  [in, optional] IDWriteFontCollection     *baseFontCollection,
  [in, optional] wchar_t const             *baseFamilyName,
                 DWRITE_FONT_WEIGHT        baseWeight,
                 DWRITE_FONT_STYLE         baseStyle,
                 DWRITE_FONT_STRETCH       baseStretch,
  [out]          UINT32                    *mappedLength,
  [out]          IDWriteFont               **mappedFont,
  [out]          FLOAT                     *scale
);

Parameters

analysisSource

Type: IDWriteTextAnalysisSource*

The text source implementation holds the text and locale.

textPosition

Type: UINT32

Starting position to analyze.

textLength

Type: UINT32

Length of the text to analyze.

[in, optional] baseFontCollection

Type: IDWriteFontCollection*

Default font collection to use.

[in, optional] baseFamilyName

Type: const wchar_t*

Family name of the base font. If you pass null, no matching will be done against the family.

baseWeight

Type: DWRITE_FONT_WEIGHT

The desired weight.

baseStyle

Type: DWRITE_FONT_STYLE

The desired style.

baseStretch

Type: DWRITE_FONT_STRETCH

The desired stretch.

[out] mappedLength

Type: UINT32*

Length of text mapped to the mapped font. This will always be less than or equal to the text length and greater than zero (if the text length is non-zero) so the caller advances at least one character.

[out] mappedFont

Type: IDWriteFont**

The font that should be used to render the first mappedLength characters of the text. If it returns NULL, that means that no font can render the text, and mappedLength is the number of characters to skip (rendered with a missing glyph).

[out] scale

Type: FLOAT*

Scale factor to multiply the em size of the returned font by.

Return value

Type: HRESULT

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

Requirements

Requirement Value
Minimum supported client Windows 8.1 [desktop apps only]
Minimum supported server Windows Server 2012 R2 [desktop apps only]
Target Platform Windows
Header dwrite_2.h
Library Dwrite.lib
DLL Dwrite.dll

See also

IDWriteFontFallback