다음을 통해 공유


IMLangFontLink2::MapFont (Windows CE 5.0)

Send Feedback

This method creates a font to output the characters from the given set of code pages or to output a character not found in a code page.

HRESULTMapFont(HDChDC,DWORDdwCodePages,WCHARchSrc,HFONT* pFont);

Parameters

  • hDC
    [in] Handle to a device context.
  • dwCodePages
    [in] Specifies the source set of code pages. This value should be set to zero when creating a font for a character identified in the chSrc parameter that is not found in a code page.
  • chSrc
    [in] Source for a Unicode character that does not map to a code page character set. This parameter is ignored unless the value of the dwCodePages parameter is set to zero.
  • pFont
    [out] Pointer to a font object where the created font will be returned.

Return Values

Returns S_OK if successful or E_FAIL otherwise.

Remarks

MLang implements a font cache to store the custom fonts created by this method. When a client has finished using a font created by this method, the client should call the IMLangFontLink2::ReleaseFont method to remove the font object from the cache.

Unlike the IMLangFontLink::MapFont method, the IMLangFontLink2::MapFont method supports non-Windows code page character font linking. To locate a font for a Unicode character not found in a code page, the value of the dwCodePages parameter must be set to zero and the chSrc parameter must contain the Unicode character source. All system fonts are then searched to locate the font that supports this character.

When using the IMLangFontLink2::MapFont method, it is assumed that the desired font is already selected in the hDC parameter.

Note   The IMLangFontLink2::GetScriptFontInfo method is an alternative to using the IMLangFontLink2::MapFont method as it performs a script-based fontlink that works with both code-page-based and non-code-page-based Unicode characters.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Mlang.h, Mlang.idl.
Link Library: Mlang.dll.

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.