SkTextBox Class Reference
#include <SkTextBox.h>
List of all members.
Public Types |
enum | Mode { kOneLine_Mode,
kLineBreak_Mode,
kModeCount
} |
enum | SpacingAlign { kStart_SpacingAlign,
kCenter_SpacingAlign,
kEnd_SpacingAlign,
kSpacingAlignCount
} |
Public Member Functions |
| SkTextBox () |
Mode | getMode () const |
void | setMode (Mode) |
SpacingAlign | getSpacingAlign () const |
void | setSpacingAlign (SpacingAlign) |
void | getBox (SkRect *) const |
void | setBox (const SkRect &) |
void | setBox (SkScalar left, SkScalar top, SkScalar right, SkScalar bottom) |
void | getSpacing (SkScalar *mul, SkScalar *add) const |
void | setSpacing (SkScalar mul, SkScalar add) |
void | draw (SkCanvas *, const char text[], size_t len, const SkPaint &) |
Detailed Description
SkTextBox is a helper class for drawing 1 or more lines of text within a rectangle. The textbox is positioned and clipped by its Frame. The Margin rectangle controls where the text is drawn relative to the Frame. Line-breaks occur inside the Margin rectangle.
Spacing is a linear equation used to compute the distance between lines of text. Spacing consists of two scalars: mul and add, and the spacing between lines is computed as: spacing = paint.getTextSize() * mul + add
Definition at line 33 of file SkTextBox.h.
Member Enumeration Documentation
- Enumerator:
kOneLine_Mode |
|
kLineBreak_Mode |
|
kModeCount |
|
Definition at line 37 of file SkTextBox.h.
- Enumerator:
kStart_SpacingAlign |
|
kCenter_SpacingAlign |
|
kEnd_SpacingAlign |
|
kSpacingAlignCount |
|
Definition at line 46 of file SkTextBox.h.
Constructor & Destructor Documentation
Member Function Documentation
void SkTextBox::draw |
( |
SkCanvas * |
, |
|
|
const char |
text[], |
|
|
size_t |
len, |
|
|
const SkPaint & |
| |
|
) |
| | |
void SkTextBox::getBox |
( |
SkRect * |
|
) |
const |
Mode SkTextBox::getMode |
( |
|
) |
const [inline] |
void SkTextBox::setBox |
( |
const SkRect & |
|
) |
|
void SkTextBox::setMode |
( |
Mode |
|
) |
|
The documentation for this class was generated from the following file: