Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

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 IMLangFontLinkand IMLangFontLink2interfaces contain the methods a client uses to perform font linking.

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

Use the IMLangFontLink2::CodePageToScriptIDmethod to retrieve the script identifier associated with a code page. Use the IMLangFontLink2::GetScriptFontInfomethod to retrieve font information for the specified script.

Use the IMLangCodePages::GetCharCodePages, IMLangCodePages::GetStrCodePages, and IMLangFontLink2::GetFontCodePagesmethods 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::GetFontUnicodeRangesto retrieve information about which Unicode characters are supported by a font. If a custom font is needed, call IMLangFontLink2::MapFontto create a font.

IMLangFontLink2implements 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::ReleaseFontmethod. This allows the font object to be deleted if the cache becomes full.

See Also