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