text

package
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Text

func Text(p r.Properties) r.Element

Text is the basic building block for a retort app. Text implements the Text Model, see Properties

Types

type Align

type Align int
const (
	AlignLeft Align = iota
	AlignCenter
	AlignRight
)

type Overflow

type Overflow int

Overflow controls if the text is allowed to spill outside it's contained While WordBreak controls what to do in the case of OverflowWrap

const (
	OverflowWrap Overflow = iota
	OverflowElipsis
	OverflowHidden
)

type Properties

type Properties struct {
	Value     string
	Overflow  Overflow
	WordBreak WordBreak

	Background tcell.Color
	Foreground tcell.Color
}

type WordBreak

type WordBreak int

WordBreak controls what happens to text greater than its width when OverflowWrap is selected.

const (
	// Normal Use the default line break rule.
	Normal WordBreak = iota
	// BreakAll To prevent overflow, word breaks should be inserted between any
	// two characters (excluding Chinese/Japanese/Korean text).
	BreakAll
	// KeepAll Word breaks should not be used for Chinese/Japanese/Korean (CJK)
	// text. Non-CJK text behavior is the same as for normal.
	KeepAll
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL