Class: TFontHandler

Declaration: FontHandler.h

Taxonomy Categories:

Member Functions:


Interface Category:

API

Inherits From:

MOrderableCollectible

Inherited By:

None.

Purpose:

Font handler objects perform the real computational work in the Font system--each TFontHandler manages a single-font data format and computes associated metrics and bitmaps. Most importantly, the font handlers know nothing about the overall architecture of the system. They only handle very specific requests for font information, without knowing who is requesting the data or how that data will be managed. The FontHandler manages all data and information related to a single font and style, such as the basic unit by which font vendors package font data. Data available from a font handler are character metrics, pixmaps, and outline curves. Each TFont object is ultimately connected to a TFontHandler object. One way of looking at the Font system is that the TFontHandler produces all the data, and the TFont is your handle on this data. How a TFont object maps to a specific TFontHandler is hidden. You simply request a font by describing a set of attributes, and it is up to the Font system to determine which TFontHandler best matches your request. The font handler is kept distinctly separate from the other aspects of the Font system, including other font handlers. This allows it to be operated equally well in different environments: as one of many font handlers in the TFontServer team, as a single font handler running in the client team, or even in a printer. It also allows other Font system aspects, like caching, to be implemented independent of the font mechanisms. The TFontHandler class is an abstract base class providing a set of pure virtual functions that define a polymorphic protocol for font data management. Different font technologies, such as TrueType and Adobe, derive from TFontHandler and implement their own data file management and computational functions. This is the chief component of the Font system being an open system. As long as the particular font technology can fulfill the protocol defined by the pure virtual base class TFontHandler, it can exist within the system. The only assumption made by the architecture is that all the data required for the font to be functional can be made available in a single segment; the specific TFontHandler derived class knows the details of how to access that segment to find all the information. Most font data files are based on embedding byte offsets within the file to make data access possible; the derived class must implement this. A primary benefit of this design is that the issue of data format portability is hidden within the specific derived class of TFontHandler. Generally, you use the data format independent functions to obtain font data. There are member functions currently under development, the TFontHandler class cannot be derived to implement a functional font subsystem extension. This class can only be used as is to access currently implemented derived class objects.

Instantiation:

Abstract base class; do not allocate.

Deriving Classes:

None.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TFontHandler::TFontHandler

TFontHandler (const TFile& file, const TToken& fontIdentifier)

Interface Category:

API.

Purpose:

Creates a new TFontHandler object and initializes the TSegment and the file name to specified values.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TFontHandler::~TFontHandler

virtual ~ TFontHandler ()

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:

Not multithread safe.

Other Considerations:

None.

Member Function: TFontHandler::operator=

TFontHandler & operator =(const TFontHandler &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Call this function by using the operator in an assignment statement.

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TFontHandler::operator>>=

virtual TStream & operator >>=(TStream &) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself out to.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TFontHandler::operator<<=

virtual TStream & operator <<= (TStream &)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself in from.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TFontHandler::Hash

virtual long Hash () const

Interface Category:

API.

Purpose:

Returns the hash value of this object.

Calling Context:

Called to obtain the hash value of this object.

Parameters:

Return Value:

The hash value of this object in a long.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TFontHandler::IsLessThan

virtual bool IsLessThan (const MOrderableCollectible *) const

Interface Category:

API.

Purpose:

Tests whether this object is less than the specified MCollectible object.

Calling Context:

Called to determine whether this object is less than the specified MCollectible object.

Parameters:

Return Value:

Returns true if this object is less than the specified MCollectible object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TFontHandler::GetIdentifier

void GetIdentifier (TToken & identifier) const

Interface Category:

API.

Purpose:

Returns the font identifier in a TToken object.

Calling Context:

Called to obtain the font identifier.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TFontHandler::IsValid

bool IsValid () const

Interface Category:

API.

Purpose:

Returns true if this object is a valid TFontHandler object (this font is valid for this to handle).

Calling Context:

Called to determine whether this object is valid.

Parameters:

Return Value:

Returns true if this object is valid.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TFontHandler::GetOriginalResolutionUnitsPerEm

virtual GCoordinate GetOriginalResolutionUnitsPerEm ()

Interface Category:

API.

Purpose:

Returns the number of resolution units per em.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the number of resolution units per em.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TFontHandler::SetTransform

  1. virtual void SetTransform (const TFastAffineMatrix *)
  2. virtual void SetTransform (const TGrafMatrix &)

Interface Category:

API.

Purpose:

  1. Sets up the transformation matrix for subsequent rendering operations.
  2. Sets up the transformation matrix for subsequent rendering operations.

Calling Context:

  1. Called to set up the transformation matrix for subsequent rendering operations.
  2. Called to set up the transformation matrix for subsequent rendering operations.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TFontHandler::SetPointSize

  1. virtual void SetPointSize (GCoordinate pointSize)
  2. virtual void SetPointSize (Fixed fixedPointSize)

Interface Category:

API.

Purpose:

  1. Sets up the point size of the font for subsequent rendering operations.
  2. Sets up the point size of the font for subsequent rendering operations.

Calling Context:

  1. Called to set up the point size of the font for subsequent rendering operations.
  2. Called to set up the point size of the font for subsequent rendering operations.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TFontHandler::GetTransformSeed

TPseudoTimeStamp GetTransformSeed () const

Interface Category:

API.

Purpose:

Returns the transform seed of the transformation matrix setup by using TFontHandler::SetTransform. This is used for fast comparisons of transformation matrices.

Calling Context:

Called to get the transform seed.

Parameters:

Return Value:

Returns the transform seed.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TFontHandler::GetScaledMetrics

virtual void GetScaledMetrics (unsigned long count, const GlyphCode glyphs [], GCoordinate advances [], GCoordinate bearings [], bool vertical =false) const

Interface Category:

API.

Purpose:

Returns the scaled layout metrics of specified glyphs. The metrics are returned scaled to the point size.

Calling Context:

Called to get the unscaled metrics.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TFontHandler::GetUnscaledMetrics

virtual void GetUnscaledMetrics (unsigned long count, const GlyphCode glyphs [], GCoordinate advances [], GCoordinate bearings [], bool vertical =false) const

Interface Category:

API.

Purpose:

Returns the unscaled layout metrics of specified glyphs. The metrics are returned in original resolution units.

Calling Context:

Called to get the scaled metrics.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.