Class: TSuperSubStyle

Declaration: LineLayoutStyles.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TLineLayoutStyle

Inherited By:

None.

Purpose:

TSuperSubStyle, derived from TLineLayoutStyle, controls superscripts and subscripts. In horizontal text, the style is used to shift text up and down and make it larger or smaller. For vertical text, this style is used to shift characters left and right and make it larger or smaller. This shifting behavior is also known as cross-stream shifting. Both position and size are determined by two numbers: an absolute number (the increment) and a multiplier (the factor). The factor is multiplied by the text's point size. The position of the text is originalPosition + positioningIncrement -positioningFactor * pointSize. Note the sign; a positive positioningFactor results in superscripted text (moving up, with smaller y-values), and a negative positioningFactor in subscripted text (moving down, with larger y-values). The point size of the text is sizeIncrement + sizeFactor * originalPointSize. For example: A factor of 1/12 will move a 12 point character up 1 point and a 24 point character up 2 points (plus the positioning increment, whatever that is). This scaling allows glyphs to be properly position when a user changes a characters point size.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

Derive classes to provide different behaviors for super- or subscripting.

Concurrency:

Multithread safe.

Resource Use:

No special requirements.

Member Function: TSuperSubStyle::GetName

virtual const TStyleName & GetName () const

Interface Category:

API.

Purpose:

Returns the style's internal name. This is not necessarily the class name. For example, there are related underlining styles that are each separate derived classes. However, because they are mutually exclusive, they share the same internal name.

Calling Context:

Called when the name associated with an object is needed; for example, when comparing objects.

Parameters:

Return Value:

The TToken for the associated name.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TSuperSubStyle::operator<<=

virtual TStream & operator <<= (TStream & fromWhere)

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:

Multithread safe.

Other Considerations:

None.

Member Function: TSuperSubStyle::operator>>=

virtual TStream & operator >>=(TStream & toWhere) 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:

Multithread safe.

Other Considerations:

None.

Member Function: TSuperSubStyle::operator==

virtual bool operator ==(const TStyle & thatStyle) const

Interface Category:

API.

Purpose:

Equality operator.

Calling Context:

Called to compare two objects.

Parameters:

Return Value:

Returns true if the objects are equal.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TSuperSubStyle::Hash

virtual long Hash () const

Interface Category:

API.

Purpose:

Overrides inherited MCollectible function.

Calling Context:

Same as for base class.

Parameters:

Return Value:

The numeric value of the hash.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TSuperSubStyle::GetScalingFactor

virtual GCoordinate GetScalingFactor () const

Interface Category:

API.

Purpose:

Returns the fraction to be used in determining point size of the super- or subscripted text relative to the point size of the main text.

Calling Context:

Called when laying out the super- or subscript text.

Parameters:

Return Value:

The fraction representing the size of the super- or subscripted text relative to the point size of the main text.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TSuperSubStyle::GetSuperSubAmount

virtual GCoordinate GetSuperSubAmount (GCoordinate & pointSize) const

Interface Category:

API.

Purpose:

Returns the absolute amount for shifting text up or down.

Calling Context:

Called when laying out the super-or subscript text.

Parameters:

Return Value:

The absolute amount for shifting text up or down.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TSuperSubStyle::~TSuperSubStyle

virtual ~ TSuperSubStyle ()

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: TSuperSubStyle::TSuperSubStyle

  1. TSuperSubStyle ()
  2. TSuperSubStyle (const TSuperSubStyle &)
  3. TSuperSubStyle (GCoordinate superSubFactor, GCoordinate scalingFactor =GCoordinate ( 1 ))
  4. TSuperSubStyle (GCoordinate positioningFactor, GCoordinate positioningIncrement, GCoordinate scalingFactor, GCoordinate scalingIncrement)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor.
  3. Constructs a super/subscript style object with specified values.
  4. Constructs a super/subscript style object with specified values.

Calling Context:

  1. Called by the stream-in operators.
  2. Called to copy an object.
  3. Call to construct a super/subscript style object with particular values.
  4. Call to construct a super/subscript style object with particular values.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TSuperSubStyle::GetPositioningIncrement

virtual GCoordinate GetPositioningIncrement () const

Interface Category:

API.

Purpose:

Returns the positioning increment for the style instance.

Calling Context:

Used to obtain the positioning increment for the style instance.

Parameters:

Return Value:

The positioning increment for the style instance.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TSuperSubStyle::GetPositioningFactor

virtual GCoordinate GetPositioningFactor () const

Interface Category:

API.

Purpose:

Returns the positioning factor for the style instance.

Calling Context:

Used to obtain the positioning factor for the style instance.

Parameters:

Return Value:

The positioning factor for the style instance.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TSuperSubStyle::GetScalingIncrement

virtual GCoordinate GetScalingIncrement () const

Interface Category:

API.

Purpose:

Returns the scaling increment for the style instance.

Calling Context:

Used to obtain the scaling increment for the style instance.

Parameters:

Return Value:

The scaling increment for the style instance.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

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.