font

package
v0.0.0-...-8e5a076 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: GPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoGlyph = errors.New("no glyph for rune")

Functions

func FixToFloat

func FixToFloat(v fixed.Int26_6) float32

func FloatToFix

func FloatToFix(f float32) fixed.Int26_6

Types

type Args

type Args struct {
	Color      color.T
	LineHeight float32
}

type Font

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

func Load

func Load(assets fs.Filesystem, filename string, size int, scale float32) *Font

func (*Font) Glyph

func (f *Font) Glyph(r rune) (*Glyph, error)

func (*Font) Kern

func (f *Font) Kern(a, b rune) float32

func (*Font) Measure

func (f *Font) Measure(text string, args Args) vec2.T

func (*Font) MeasureLine

func (f *Font) MeasureLine(text string) vec2.T

func (*Font) Name

func (f *Font) Name() string

func (*Font) Size

func (f *Font) Size() float32

type Glyph

type Glyph struct {
	Size    vec2.T
	Bearing vec2.T
	Advance float32
	Mask    *image.Data
	// contains filtered or unexported fields
}

func (*Glyph) Key

func (r *Glyph) Key() string

func (*Glyph) LoadTexture

func (r *Glyph) LoadTexture(fs.Filesystem) *texture.Data

func (*Glyph) Version

func (r *Glyph) Version() int

Jump to

Keyboard shortcuts

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