text

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: Unlicense Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alignment

type Alignment int
const (
	AlignStart Alignment = iota
	AlignEnd
	AlignCenter
)

type Formatter added in v1.3.6

type Formatter struct {
	// contains filtered or unexported fields
}

Formatter is a poor man's fmt.Sprintf that doesn't allocate. TODO: It can be replaced when something like https://github.com/golang/go/issues/62653 is implemented in the Go implementation.

func (*Formatter) Next added in v1.3.6

func (f *Formatter) Next(format string, args ...any) (rune, bool)

type Glyph added in v1.3.2

type Glyph struct {
	Rune    rune
	Dot     fixed.Int26_6
	Advance fixed.Int26_6
}

type Layout added in v1.3.2

type Layout struct {
	MaxWidth int
	Style    Style
	// contains filtered or unexported fields
}

func (*Layout) Next added in v1.3.2

func (l *Layout) Next(format string, args ...any) (Glyph, bool)

TODO: Convert to iterator when TinyGo can move its allocations to the stack.

type Style

type Style struct {
	Face            *bitmap.Face
	Alignment       Alignment
	LineHeightScale float32
	LetterSpacing   int
}

func (Style) LineHeight

func (l Style) LineHeight() int

func (Style) Measure added in v1.3.2

func (s Style) Measure(maxWidth int, format string, args ...any) image.Point

Jump to

Keyboard shortcuts

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