Class: TFontSubstituter

Declaration: FontSubstitution.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

TStandardFontSubstituter

Purpose:

Provides an abstract interface for font substitution. Because most fonts cannot display every character represented by Unicode, you can use font substitution to reset the font information for a text object before displaying it. This guarantees that every character will be correctly displayed, assuming that a font that can display that character is installed on your system.

Instantiation:

Abstract base class; do not instantiate.

Deriving Classes:

A specific implementation of font substitution is provided by the TStandardFontSubstituter class. Anyone wanting to provide their own font substitution algorithm should derive from TFontSubstituter.

Concurrency:

Multithread safe.

Resource Use:

No special requirements.

Member Function: TFontSubstituter::StyleMissingCharactersOnEntry

virtual bool StyleMissingCharactersOnEntry (TText & text, const TTextRange & range =TTextRange :: GetMaximumRange (), const TStyleSet * paragraphStyles =NIL)

Interface Category:

API.

Purpose:

Updates font information for characters as they are typed in.

Calling Context:

Called by the Text Editing framework and other clients who wish to incrementally update the font information for a text object as characters are entered.

Parameters:

Return Value:

Returns true if the font information for the text object is changed by this function.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TFontSubstituter::StyleMissingCharacters

virtual bool StyleMissingCharacters (TText & text, const TTextRange & range =TTextRange :: GetMaximumRange (), const TStyleSet * paragraphStyles =NIL)

Interface Category:

API.

Purpose:

Updates the font information for characters in a text object. The font information for characters within the given range of the given text is updated as necessary to guarantee that they can be drawn correctly.

Calling Context:

This is the usual function to use when updating font information, for example, when a static text object is being set up.

Parameters:

Return Value:

Returns true if the font information for the text object is changed by this function.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TFontSubstituter::SetFont

virtual bool SetFont (const TFontFamilyStyle & fontStyle, TText & text, const TTextRange & range =TTextRange :: GetMaximumRange ())

Interface Category:

API.

Purpose:

Sets a font for characters in a text object. This function only applies the specified font to the characters in the text which can be displayed with this font.

Calling Context:

Call directly to set a specific font, for example, for a static text object such as a menu name. Should be followed by a call to StyleMissingCharacters to make sure that all the characters in the text will be displayed.

Parameters:

Return Value:

Returns true if the font information for the text parameter is changed by this function.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TFontSubstituter::FancySetFont

virtual bool FancySetFont (const TFontFamilyStyle & fontStyle, TText & text, const TTextRange & range =TTextRange :: GetMaximumRange ())

Interface Category:

API.

Purpose:

A more sophisticated (and slower) version of SetFont which attempts to keep spaces and punctuation in the same font as the surrounding text.

Calling Context:

Call directly to set a specific font, for example, for a static text object such as a menu name. Should be followed by a call to StyleMissingCharacters to make sure that all the characters in the text will be displayed.

Parameters:

Return Value:

Returns true if the font information for the text parameter has changed.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TFontSubstituter::~TFontSubstituter

virtual ~ TFontSubstituter ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TFontSubstituter::TFontSubstituter

TFontSubstituter ()

Interface Category:

API.

Purpose:

Default constructor.

Calling Context:

Called by the stream-in operators and by derived class constructors.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

Abstract class; do not instantiate directly.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.