Requesting specific fonts

Use the SetFont member function to request that a specific font be used to display your text for all appropriate characters. This function scans your text and applies the specified font to all characters that can be displayed in that font. This procedure ensures that the font of your choice is used for those characters rather than the first acceptable font located by the font substituter.

For example, to force the text in the example above to be displayed using your choice of Greek font, you could do the following:

      TToken greekFontName( "Greek" );
      TFontFamilyStyle greekFont( greekFontName );
      substituter.SetFont( greekFont, text );
You can also use the function FancySetFont. This function is similar to SetFont, but it also tries to keep punctuation in the same font as surrounding text as much as possible. This function takes longer to analyze the text than SetFont, but it breaks the text into fewer style runs--so displaying the resulting text may be faster.

NOTE The SetFont and FancySetFont functions do not apply a font to characters that do not have corresponding glyphs in the specified font. You still need to call StyleMissingCharacters to ensure that all characters display correctly.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker