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:
- TText & text -The text object whose font information is to be updated.
- const TTextRange & range -The range within the text object within which to update font information. Defaults to the entire text object.
- const TStyleSet * paragraphStyles -Defaults to NIL. If not NIL, used to determine the default font for this text object; any font information already associated with the text object is used first. If NIL, the default font is assumed to be the system font.
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:
- TText & text -The text object whose font information is to be updated. Defaults to the entire text object.
- const TTextRange & range -The range within the text object within which to update font information.
- const TStyleSet * paragraphStyles -Defaults to NIL; if not NIL, used to determine the default font for this text object; any font information already associated with the text object is used first. If NIL, the default font is assumed to be the system font.
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.
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:
- const TFontFamilyStyle & fontStyle -The font to which the text should be set (where possible).
- TText & text -The text object whose font information is to be updated.
- const TTextRange & range -The range within the text object within which to update font information. Defaults to the entire text object.
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.
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:
- const TFontFamilyStyle & fontStyle -The font to which the text should be set (where possible).
- TText & text -The text object whose font information is to be updated. Defaults to the entire text object.
- const TTextRange & range -The range within the text object within which to update font information. Defaults to the entire text object.
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.
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.
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.