text

package
v0.0.0-...-6902453 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ShaperContext = contextutil.New[*text.Shaper](contextutil.Defaulter(func() *text.Shaper {
	return DefaultShaper
}))

Functions

This section is empty.

Types

type Alignment

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

func (Alignment) TextAlignment

func (a Alignment) TextAlignment() text.Alignment

type FontFamilySetter

type FontFamilySetter interface {
	SetFontFamily(fontFamily string)
}

type FontSizeSetter

type FontSizeSetter interface {
	SetFontSize(size unit.Sp)
}

type FontStyleSetter

type FontStyleSetter interface {
	SetFontStyle(style font.Style)
}

type FontWeightSetter

type FontWeightSetter interface {
	SetFontWeight(w weight.Weight)
}

type LineHeightSetter

type LineHeightSetter interface {
	SetLineHeight(size unit.Sp)
}

type Style

type Style struct {
	FontFamily string
	FontWeight weight.Weight
	FontStyle  *font.Style

	FontSize   unit.Sp
	LineHeight unit.Sp
	// Not Implemented
	LetterSpacing unit.Sp

	Color     color.NRGBA
	TextAlign *Alignment
}

func (*Style) Eq

func (s *Style) Eq(style *Style) cmp.Result

func (Style) Merge

func (s Style) Merge(style Style) Style

func (*Style) SetFontFamily

func (s *Style) SetFontFamily(fontFamily string)

func (*Style) SetFontSize

func (s *Style) SetFontSize(fontSize unit.Sp)

func (*Style) SetFontStyle

func (s *Style) SetFontStyle(style font.Style)

func (*Style) SetFontWeight

func (s *Style) SetFontWeight(w weight.Weight)

func (*Style) SetLineHeight

func (s *Style) SetLineHeight(lineHeight unit.Sp)

func (*Style) SetStyle

func (s *Style) SetStyle(style Style)

func (*Style) SetTextAlign

func (s *Style) SetTextAlign(textAlign Alignment)

func (*Style) SetTextColor

func (s *Style) SetTextColor(c color.Color)

func (Style) ToFont

func (s Style) ToFont() font.Font

type StyleSetter

type StyleSetter interface {
	SetStyle(s Style)
}

type TextAlignSetter

type TextAlignSetter interface {
	SetTextAlign(a Alignment)
}

type TextColorSetter

type TextColorSetter interface {
	SetTextColor(color color.Color)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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