Documentation
¶
Index ¶
- Constants
- Variables
- func FillLabel(gtx layout.Context, shaper *text.Shaper, style TextStyle, rect image.Rectangle, ...) layout.Dimensions
- func FillText(gtx layout.Context, shaper *text.Shaper, style TextStyle, rect image.Rectangle, ...)
- func Label(shaper *text.Shaper, style TextStyle, ax, ay float32, radius int, ...) layout.Widget
- func MeasureText(gtx layout.Context, shaper *text.Shaper, style TextStyle, str string) image.Point
- func Text(shaper *text.Shaper, style TextStyle, ax, ay float32, fill color.Color, ...) layout.Widget
- type FontFace
- type TextStyle
Constants ¶
Variables ¶
View Source
var Default = EN_US
View Source
var EN_US = system.Locale{Language: "en-US", Direction: system.LTR}
View Source
var NL = system.Locale{Language: "nl", Direction: system.LTR}
View Source
var ZH_CN = system.Locale{Language: "zh-CN", Direction: system.LTR}
Functions ¶
func MeasureText ¶
Types ¶
type TextStyle ¶
type TextStyle struct {
// Font describes the preferred typeface.
Font font.Font
// Alignment characterizes the positioning of text within the line. It does not directly
// impact shaping, but is provided in order to allow efficient offset computation.
Alignment text.Alignment
// Size is the Sp size to shape the text with.
Size unit.Sp
// MaxLines limits the quantity of shaped lines. Zero means no limit.
MaxLines int
// Truncator is a string of text to insert where the shaped text was truncated, which
// can currently ohly happen if MaxLines is nonzero and the text on the final line is
// truncated.
Truncator string
// WrapPolicy configures how line breaks will be chosen when wrapping text across lines.
WrapPolicy text.WrapPolicy
}
TextStyle contains the styling parameters for a block of text.
Click to show internal directories.
Click to hide internal directories.