InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SLCParagraphComposer Class Reference
Inheritance diagram for SLCParagraphComposer:
CPMUnknown< IParagraphComposer >IParagraphComposerIPMUnknown

Public Member Functions

 SLCParagraphComposer (IPMUnknown *boss)
 
virtual ~SLCParagraphComposer (void)
 
virtual bool16 Recompose (IParagraphComposer::RecomposeHelper *helper)
 
virtual bool16 RebuildLineToFit (IParagraphComposer::RebuildHelper *helper)
 
virtual bool16 RebuildLineWithOverrides (IParagraphComposer::RebuildHelper *helper, const AttributeBossList *overrides, bool16 clearOverrides=kFalse)
 
- Public Member Functions inherited from CPMUnknown< IParagraphComposer >
IPMUnknownQueryInterface (PMIID interfaceID) const
 
void AddRef () const
 
void Release () const
 
void PreDirty (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue)
 
void PreDirtyNoMessage (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue)
 
 CPMUnknown (const CPMUnknown &)=delete
 
CPMUnknownoperator= (const CPMUnknown &)=delete
 

Additional Inherited Members

- Public Types inherited from IParagraphComposer
enum  { kDefaultIID = IID_IPARAGRAPHCOMPOSER }
 
enum  { kDefaultServiceID = kTextEngineService }
 
- Protected Member Functions inherited from CPMUnknown< IParagraphComposer >
 CPMUnknown (IPMUnknown *boss)
 
- Protected Attributes inherited from CPMUnknown< IParagraphComposer >
HelperInterface fHelperInterface
 

Detailed Description

Composes a single line of text and as output generates a wax line (IWaxLine) and associated wax runs (IWaxRun).

There are two distinct roles that a paragraph composer(IParagraphComposer) performs:

  1. Positioning the line and, if necessary, deciding where the text in the line should break. This information is represented persistently in the wax line. In this implementation this role is delegated by the Recompose method to SLCLineBreaker. Features that affect line break decisions, hyphenation for example, belong here.
  2. Positioning glyphs in the line and, if necessary, adjusting their width. This information is represented by a set of wax runs associated with the wax line. Wax runs are not persistent and must be rebuilt for display when a wax line is read from disc. In this implementation this role is delegated by the RebuildLineToFit method to SLCLineFitter. Features that affect glyph position, centre alignment, justification, word spacing, letter spacing, kerning for example, belong here.

Features supported by this implementation:

  • Roman text composition(baseline, leading, ascent, cap height);
  • Paragraph left indent, right indent and first line left indent;
  • Baseline grid alignment;
  • Unencoded glyphs(fonts with glyphs that have no corresponding Unicode character code);
  • Proportional width adjustment of trailing white space in the line;
  • Text wrap;
  • First baseline offset(allows the offset from top of a parcel to the first baseline of text in the parcel to be controlled).

This implementation shows the basics involved in the composition of Roman text. A production quality implementation would have to account for many more features (e.g. hyphenation, justification, kerning etc.).

See Also
SLCLineBreaker
SLCLineFitter
IWaxLine
IWaxRun

Constructor & Destructor Documentation

Binds the C implementation class onto its ImplementationID making the C code callable by the application * SLCParagraphComposer::SLCParagraphComposer (IPMUnknownboss)

Constructor.

Parameters
bossinterface ptr from boss object on which this interface is aggregated.
SLCParagraphComposer::~SLCParagraphComposer (void )
virtual

Destructor

Member Function Documentation

bool16 SLCParagraphComposer::RebuildLineToFit (IParagraphComposer::RebuildHelperhelper)
virtual

This is used to regenerate composed text data from the minimal data stored on disk. It is ok to return kFalse and not do anything.

Parameters
helper

Implements IParagraphComposer.

virtual bool16 SLCParagraphComposer::RebuildLineWithOverrides (IParagraphComposer::RebuildHelperhelper,
const AttributeBossListoverrides,
bool16 clearOverrides = kFalse 
)
inlinevirtual

This is used to regenerate composed text data with overrides. It is ok to return kFalse and not do anything.

Parameters
helper
overrides
clearOverrides- set true if overrides need to be cleared and not applied.

Implements IParagraphComposer.

bool16 SLCParagraphComposer::Recompose (IParagraphComposer::RecomposeHelperhelper)
virtual

Build IWaxLines using the specified helper.

Parameters
helperIN provides information to drive recomposition
Returns
kTrue if the composer applied at least one line into the helper, kFalse otherwise.

Implements IParagraphComposer.