font

package
v1.5.54 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ByFont = map[string]map[string]*Face{}
	ByName = map[string]*Face(nil)
)

Functions

func CurrentFont added in v1.4.119

func CurrentFont() string

func KeepInCache

func KeepInCache()

We always keep the game character set in cache. This has to be repeated regularly as Ebitengine expires unused cache entries.

func LoadIntoCacheStepwise added in v1.3.421

func LoadIntoCacheStepwise() func(s *splash.State) (splash.Status, error)

func SetFont added in v1.3.263

func SetFont(font string) error

Types

type Align added in v1.3.263

type Align int
const (
	AsBounds Align = iota
	Left
	Center
	Right
)

type Face

type Face struct {
	Face    font.Face
	Outline font.Face
}

Face is an alias to font.Face so users do not need to import the font package.

func (Face) BoundString

func (f Face) BoundString(str string) m.Rect

BoundString returns the bounding rectangle of the given text.

func (Face) Draw

func (f Face) Draw(dst draw.Image, str string, pos m.Pos, boxAlign Align, fg, bg color.Color)

Draw draws the given text.

Jump to

Keyboard shortcuts

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