text

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT, Unlicense Imports: 30 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alignment

type Alignment uint8
const (
	Start Alignment = iota
	End
	Middle
)

func (Alignment) Align

func (a Alignment) Align(dir system.TextDirection, width fixed.Int26_6, maxWidth int) fixed.Int26_6

func (Alignment) String

func (a Alignment) String() string

type Flags

type Flags uint16
const (
	FlagTowardOrigin Flags = 1 << iota

	FlagLineBreak

	FlagRunBreak

	FlagClusterBreak

	FlagParagraphBreak

	FlagParagraphStart

	FlagTruncator
)

func (Flags) String

func (f Flags) String() string

type FontFace

type FontFace = giofont.FontFace

type Glyph

type Glyph struct {
	ID GlyphID

	X fixed.Int26_6

	Y int32

	Advance fixed.Int26_6

	Ascent fixed.Int26_6

	Descent fixed.Int26_6

	Offset fixed.Point26_6

	Bounds fixed.Rectangle26_6

	Runes uint16

	Flags Flags
}

type GlyphID

type GlyphID uint64

type Parameters

type Parameters struct {
	Font giofont.Font

	Alignment Alignment

	PxPerEm fixed.Int26_6

	MaxLines int

	Truncator string

	WrapPolicy WrapPolicy

	MinWidth, MaxWidth int

	Locale system.Locale

	LineHeightScale float32

	LineHeight fixed.Int26_6

	DisableSpaceTrim bool
	// contains filtered or unexported fields
}

type Range

type Range struct {
	Count  int
	Offset int
}

type Shaper

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

func NewShaper

func NewShaper(options ...ShaperOption) *Shaper

func (*Shaper) Bitmaps

func (l *Shaper) Bitmaps(gs []Glyph) op.CallOp

func (*Shaper) Layout

func (l *Shaper) Layout(params Parameters, txt io.Reader)

func (*Shaper) LayoutString

func (l *Shaper) LayoutString(params Parameters, str string)

func (*Shaper) NextGlyph

func (l *Shaper) NextGlyph() (_ Glyph, ok bool)

func (*Shaper) Shape

func (l *Shaper) Shape(gs []Glyph) clip.PathSpec

type ShaperOption

type ShaperOption func(*Shaper)

func NoSystemFonts

func NoSystemFonts() ShaperOption

func WithCollection

func WithCollection(collection []FontFace) ShaperOption

type WrapPolicy

type WrapPolicy uint8
const (
	WrapHeuristically WrapPolicy = iota

	WrapWords

	WrapGraphemes
)

Jump to

Keyboard shortcuts

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