Documentation
¶
Index ¶
- type Measurer
- type TextEngine
- type TextLayout
- func (l *TextLayout) Attachment(i int) (driver.Bounds, bool)
- func (l *TextLayout) CaretRect(c driver.Caret) (driver.Bounds, bool)
- func (l *TextLayout) HitTest(p driver.Point) driver.Caret
- func (l *TextLayout) RangeRects(start, end int, out []driver.Bounds) []driver.Bounds
- func (*TextLayout) Release()
- func (l *TextLayout) TextLines() []driver.TextLine
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Measurer ¶
type Measurer interface {
// Width is the advance of text in font, a CSS font shorthand.
Width(font, text string) float64
}
Measurer measures text in the host's fonts.
type TextEngine ¶
type TextEngine struct {
// contains filtered or unexported fields
}
TextEngine is driver.TextEngine over a Measurer.
func NewTextEngine ¶
func NewTextEngine(m Measurer) *TextEngine
NewTextEngine returns an engine measuring with m.
func (*TextEngine) Prepare ¶
func (e *TextEngine) Prepare(t *driver.AttributedText) driver.PreparedText
Prepare implements driver.TextEngine.
type TextLayout ¶
type TextLayout struct {
// contains filtered or unexported fields
}
TextLayout is the text laid out at its final size: what the render layer draws.
func (*TextLayout) Attachment ¶
func (l *TextLayout) Attachment(i int) (driver.Bounds, bool)
Attachment implements core.AttachmentLayout.
func (*TextLayout) HitTest ¶
func (l *TextLayout) HitTest(p driver.Point) driver.Caret
HitTest implements driver.TextHitTester.
func (*TextLayout) RangeRects ¶
RangeRects implements driver.TextHitTester.
func (*TextLayout) TextLines ¶
func (l *TextLayout) TextLines() []driver.TextLine
TextLines implements core.LineLayout.