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.

IDWriteFontFallback::MapCharacters method

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

Syntax


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

Parameters

source

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.

baseFontCollection [in, optional]

Type: IDWriteFontCollection*

Default font collection to use.

baseFamilyName [in, optional]

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.

mappedLength [out]

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.

mappedFont [out]

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

scale [out]

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

Minimum supported client

Windows 8.1 [desktop apps only]

Minimum supported server

Windows Server 2012 R2 [desktop apps only]

Minimum supported phone

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

Library

Dwrite.lib

DLL

Dwrite.dll

See also

IDWriteFontFallback

 

 

Show:
© 2017 Microsoft