InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SLCTileComposer Class Reference

#include <SLCTileComposer.h>

Public Member Functions

 SLCTileComposer (IComposeScanner *composeScanner, const PMReal &xPosition, const TextIndex &startingIndex)
 
virtual ~SLCTileComposer (void)
 
virtual SLComposerStatusCode FlowTextByTileWidth (const SLCTileMeasure &tile, SLCGlyphNodeList &glyphNodeList)
 
virtual SLComposerStatusCode FlowTextByTileTextSpan (const SLCTileMeasure &tile, SLCGlyphNodeList &glyphNodeList)
 
int32 GetTextSpan (void) const
 
PMReal GetTextWidth (void) const
 
int32 GetFitTextSpan (void) const
 
PMReal GetFitTextWidth (void) const
 

Detailed Description

Uses the scanner (IComposeScanner) to flow text into a tile generating a glyph node (SLCGlyphNode) in SLCGlyphNodeList for each run. Also caches additional metrics that describe the flowed text.

See Also
SLCGlyphNode
SLCGlyphNodeList
SLCTileMeasure
IComposeScanner
IDrawingStyle

Constructor & Destructor Documentation

SLCTileComposer::SLCTileComposer (IComposeScannercomposeScanner,
const PMRealxPosition,
const TextIndex & startingIndex 
)
inline

Constructor prepares object to flow text.

Parameters
composeScannerfor accessing text (ref count gets bumped).
xPositionleft edge of line containing tile.
startingIndexTextIndex of first character to be flowed into tile.
virtual SLCTileComposer::~SLCTileComposer (void )
inlinevirtual

Tidies up.

Member Function Documentation

SLComposerStatusCode SLCTileComposer::FlowTextByTileTextSpan (const SLCTileMeasuretile,
SLCGlyphNodeListglyphNodeList 
)
virtual

Flow the range of characters, fTextIndex:fTextIndex+tile.fTextSpan, into the tile.

Parameters
tileleft edge and width of area in which to flow text and number of characters to be flowed(tile.fXPosition, tile.fWidth, tile.fTextSpan).
Returns
kCompSuccess or kCompEndOfLine on success, other status otherwise.
Postcondition
SLCGlyphNodeList nodes created for each run of text.
the width of the characters in the tile may exceed the width of the tile if there is trailing white space.
GetTextSpan == GetFitTextSpan the characters fit within the tile.
GetTextSpan > GetFitTextSpan the characters don't fit within the tile.
GetTextWidth == GetFitTextWidth the characters fit within the tile.
GetTextWidth > GetFitTextWidth the characters don't fit within the tile.
SLComposerStatusCode SLCTileComposer::FlowTextByTileWidth (const SLCTileMeasuretile,
SLCGlyphNodeListglyphNodeList 
)
virtual

Flow characters into the tile creating a glyph node(SLCGlyphNode) for each run until the tile width is reached or an end of line character is detected. If the tile width is reached and trailing white space characters follow the last flowed character add the trailing white space into the tile (text should not be broken before trailing white space).

Parameters
tileleft edge and width of area in which to flow text(tile.fXPosition, tile.fWidth).
Returns
kCompSuccess or kCompEndOfLine on success, other status otherwise.
Postcondition
SLCGlyphNodeList nodes created for each run of text.
the width of the characters in the tile may exceed the width of the tile if there is trailing white space.
GetTextSpan == GetFitTextSpan the characters fit within the tile.
GetTextSpan > GetFitTextSpan the characters don't fit within the tile.
GetTextWidth == GetFitTextWidth the characters fit within the tile.
GetTextWidth > GetFitTextWidth the characters don't fit within the tile.
int32 SLCTileComposer::GetFitTextSpan (void ) const
inline
Returns
the number of characters that fit within the tile. Note this can include trailing white space that fits.
PMReal SLCTileComposer::GetFitTextWidth (void ) const
inline
Returns
the width of the characters that fit within the tile. Note this can include the width of trailing white space that fits.
int32 SLCTileComposer::GetTextSpan (void ) const
inline
Returns
the total number of characters flowed into the tile.
PMReal SLCTileComposer::GetTextWidth (void ) const
inline
Returns
the total width of characters flowed into the tile.