Documentation ¶
Index ¶
- type Text
- func (t *Text) Draw(s tcell.Screen)
- func (t *Text) Draw2(s tcell.Screen)
- func (t *Text) DrawableRect() image.Rectangle
- func (t *Text) FillRuneBuffer(r image.Rectangle) [][]rune
- func (t *Text) ProcessCenterAlignment(r image.Rectangle) [][]rune
- func (t *Text) ProcessFullAlignment(r image.Rectangle) [][]rune
- func (t *Text) ProcessLeftAlignment(r image.Rectangle) [][]rune
- func (t *Text) ProcessRightAlignment(r image.Rectangle) [][]rune
- func (t *Text) ProcessUnwrapped(x int, maxWidth int) map[int]rune
- func (t *Text) SetTheme(theme *tooey.Theme)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Text ¶
Text represents a simple styled block of text with wrapping paragraph capabilities
func (*Text) Draw ¶
func (t *Text) Draw(s tcell.Screen)
Draw draws the text to its given Rect taking into account left and right padding, wrapping, etc
func (*Text) DrawableRect ¶
DrawableRect returns a set of ints representing the calculated drawable space based on all padding and positioning
Returns image.Rectangle
func (*Text) FillRuneBuffer ¶
FillRuneBuffer prefills a buffer of size image.Rectangle for filling drawable text areas
This is unfortunately destructive and prevents things like overlapping which may or may not be desirable but it was the way I could think of to prepare a buffer for managing alignment of text within a text space
func (*Text) ProcessCenterAlignment ¶
ProcessCenterAlignment ...
func (*Text) ProcessFullAlignment ¶
ProcessFullAlignment ...
func (*Text) ProcessLeftAlignment ¶
ProcessLeftAlignment accepts a space of image.Rectangle and processes Text.Content within that space to be left justified, and attempt to wrap word-aware when possible. If the word will fit on a line by itself it will wrap, otherwise it will wrap mid-word.
returns [y][x]rune
func (*Text) ProcessRightAlignment ¶
ProcessRightAlignment accepts a space of image.Rectangle and processes Text.Content within that space to be right justified and attempt to wrap word-aware when possible. If the word will fit on a line by itself it will wrap, otherwise it will wrap mid-word
returns [y][x]rune