Share via


Font Linking

MLang implements a service called font linking to assist developers who must output strings that contain characters from a variety of character sets. This service creates a custom font that inherits from a specified source font. The IMLangFontLink and IMLangFontLink2 interfaces contain the methods a client uses to perform font linking.

The IMLangFontLink2 interface subsumes the functionality of IMLangFontLink and adds methods to retrieve font information from scripts, and to determine whether a given character is supported in Unicode. Both interfaces inherit from the IMLangCodePages interface, allowing direct access to the code page methods.

Use the IMLangFontLink2::CodePageToScriptID method to retrieve the script identifier associated with a code page. Use the IMLangFontLink2::GetScriptFontInfo method to retrieve font information for the specified script.

Use the IMLangCodePages::GetCharCodePages, IMLangCodePages::GetStrCodePages, and IMLangFontLink2::GetFontCodePages methods to determine if a custom font is needed for the given string or character.

Try to use a font that will display as many of the characters in the string as possible. This helps limit the number of times a custom font must be created.You can use the IMLangFontLink2::GetFontUnicodeRanges to retrieve information about which Unicode characters are supported by a font. If a custom font is needed, call IMLangFontLink2::MapFont to create a font.

IMLangFontLink2 implements a font cache to store the custom fonts that are created. When a custom font is no longer being used, it must be released from the font cache through the IMLangFontLink2::ReleaseFont method. This allows the font object to be deleted if the cache becomes full.

See Also

Internet Explorer Multiple-Language API

 Last updated on Thursday, April 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.