struct CCL::ITextLayout
Overview
#include <itextlayout.h> struct ITextLayout: public CCL::IUnknown { // enums enum LineMode; enum MeasureFlags; // structs struct Range; // methods virtual tresult CCL_API construct ( StringRef text, Coord width, Coord height, FontRef font, LineMode lineMode = kMultiLine, TextFormatRef format = TextFormat () ) = 0; virtual tresult CCL_API construct ( StringRef text, CoordF width, CoordF height, FontRef font, LineMode lineMode = kMultiLine, TextFormatRef format = TextFormat () ) = 0; virtual StringRef CCL_API getText () const = 0; virtual tresult CCL_API resize (Coord width, Coord height) = 0; virtual tresult CCL_API resize (CoordF width, CoordF height) = 0; virtual tresult CCL_API setFontStyle ( const Range& range, int style, tbool state ) = 0; virtual tresult CCL_API setFontSize (const Range& range, float size) = 0; virtual tresult CCL_API setSpacing (const Range& range, float spacing) = 0; virtual tresult CCL_API setLineSpacing (const Range& range, float lineSpacing) = 0; virtual tresult CCL_API setTextColor (const Range& range, Color color) = 0; virtual tresult CCL_API getBounds (Rect& bounds, int flags = 0) const = 0; virtual tresult CCL_API getBounds (RectF& bounds, int flags = 0) const = 0; virtual tresult CCL_API getImageBounds (RectF& bounds) const = 0; virtual tresult CCL_API getBaselineOffset (PointF& offset) const = 0; virtual tresult CCL_API hitTest (int& textIndex, PointF& position) const = 0; virtual tresult CCL_API getCharacterBounds (RectF& bounds, int textIndex) const = 0; virtual tresult CCL_API getTextBounds ( IMutableRegion& bounds, const Range& range ) const = 0; virtual tresult CCL_API getLineRange (Range& range, int textIndex) const = 0; virtual tresult CCL_API getWordRange (Range& range, int textIndex) const = 0; virtual tresult CCL_API getExplicitLineRange (Range& range, int textIndex) const = 0; virtual tresult CCL_API setBaselineOffset (const Range& range, float offset) = 0; virtual tresult CCL_API setSuperscript (const Range& range) = 0; virtual tresult CCL_API setSubscript (const Range& range) = 0; };
Inherited Members
public: // methods virtual tresult CCL_API queryInterface (UIDRef iid, void** ptr) = 0; virtual unsigned int CCL_API retain () = 0; virtual unsigned int CCL_API release () = 0;
Detailed Documentation
Text layout interface.
Methods
virtual tresult CCL_API construct ( StringRef text, Coord width, Coord height, FontRef font, LineMode lineMode = kMultiLine, TextFormatRef format = TextFormat () ) = 0
Initialize text layout.
virtual tresult CCL_API construct ( StringRef text, CoordF width, CoordF height, FontRef font, LineMode lineMode = kMultiLine, TextFormatRef format = TextFormat () ) = 0
Initialize text layout (float coordinates).
virtual StringRef CCL_API getText () const = 0
Get plain unformatted text (that was used to construct the layout).
virtual tresult CCL_API resize (Coord width, Coord height) = 0
Resize the text layout.
virtual tresult CCL_API resize (CoordF width, CoordF height) = 0
Resize the text layout (float coordinates).
virtual tresult CCL_API setFontStyle ( const Range& range, int style, tbool state ) = 0
Set font style for given text range (.
See also:
virtual tresult CCL_API setFontSize (const Range& range, float size) = 0
Set font size for given text range.
virtual tresult CCL_API setSpacing (const Range& range, float spacing) = 0
Set character spacing for given text range.
virtual tresult CCL_API setLineSpacing (const Range& range, float lineSpacing) = 0
Set line spacing for given text range.
virtual tresult CCL_API setTextColor (const Range& range, Color color) = 0
Set color for given text range.
virtual tresult CCL_API getBounds (Rect& bounds, int flags = 0) const = 0
Get bounding rectangle of formatted text.
virtual tresult CCL_API getBounds (RectF& bounds, int flags = 0) const = 0
Get bounding rectangle of formatted text.
virtual tresult CCL_API getImageBounds (RectF& bounds) const = 0
Get tightly enclosing rectangle of the text’s glyphs.
virtual tresult CCL_API getBaselineOffset (PointF& offset) const = 0
Get the offset of the text’s baseline (in addition to the text alignment).
virtual tresult CCL_API hitTest (int& textIndex, PointF& position) const = 0
Get the text position and coordinates of the cluster at the given position.
virtual tresult CCL_API getCharacterBounds (RectF& bounds, int textIndex) const = 0
Get bounds of the character at textIndex.
The bounds height is the line height.
virtual tresult CCL_API getTextBounds ( IMutableRegion& bounds, const Range& range ) const = 0
Get a set of rectangles which fully enclose the text in the given range.
virtual tresult CCL_API getLineRange (Range& range, int textIndex) const = 0
Get the text range of the line at the given text position, possibly ending with a newline character.
virtual tresult CCL_API getWordRange (Range& range, int textIndex) const = 0
Get the text range of the word at the given text position.
If textIndex is between words, the range refers to the characters inbetween. The range does not include newlines.
virtual tresult CCL_API getExplicitLineRange (Range& range, int textIndex) const = 0
Get the text range of the line at the given text position not considering layout line breaks but only explicit linebreaks by newline characters.
The range does not include the newline character.
virtual tresult CCL_API setBaselineOffset (const Range& range, float offset) = 0
Set baseline up (positive offset) or down (negative offset) to shift text vertically.
virtual tresult CCL_API setSuperscript (const Range& range) = 0
Set superscript for text range.
virtual tresult CCL_API setSubscript (const Range& range) = 0
Set subscript for text range.