ADStraightTextObject Class Reference


Detailed Description

This class is used to draw text blocks which are in straight lines, either singularly or multiple lines. It supports styles as well as alignment settings. The most important method within this class is BuildTextFragments2 which is a high-performance calculation system. BuildTextFragments is a slower version which does not support alignment. (see AD comments below)

BuildTextFragments2 works by render complete style runs as a single block rather than calculating information for each and every character. This results in a dramatic performance boost as well as better character layout results.

The layout calculations are as follows: 1. Generate line start and line length arrays. 2. Build a list of all style runs within the text block. 3. Calculate the heights of each line 4. Calculate the horizontal offset for each line based upon the alignment requirements. 5. Build a text block for each style run in every line and add it to the rendering list.

The class Draw() method adds the generated shapes to the instance group object for rendering puropses. The BuildTextFragments2 method does NOT render. That is left to the Draw method.

AD Comments on rewriting BuildTextFragments

Rewritten to make optimal use of the new RB5.5 styledText and because of a few bugs particularly under Windows.

The motivation behind some things is that the word-wrapping of lines doesn't affect the StyledText StyleRun or Paragraph classes (see StyleRunStats test).

We therefore still need to break things into our own blocks and work out the line dimensions.

Exact nature of how text offsets are calculated

mDrawGroup is recreated in ADStraightTextObject.Draw with coords of 0,0 After assigning all the text fragments to it, it is set to mDragObject.X/Y which means they will all translate (this is after rotation).


The documentation for this class was generated from the following file:
Generated on Sat Nov 11 10:52:59 2006 for mf2 by  doxygen 1.5.1