font

package
v0.0.0-...-1b23d78 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2019 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MatchSysFonts

func MatchSysFonts(name string) string

func ReadSysFontFile

func ReadSysFontFile(filename string) (buf []byte, err error)

Types

type Glyph

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

Glyph position

type GlyphImage

type GlyphImage struct {
	Tex    int
	Pixels []byte
	X      int32
	Y      int32
	Width  uint32
	Height uint32
}

type Glyphs

type Glyphs []*Glyph

type Manager

type Manager struct {
	AllocTexture  func(size int) (int, error)
	ResizeTexture func(texture, size int) error
	CloseTexture  func(texture int) error

	//PutGlyphImages func(imgs []GlyphImage)
	Match    func(name string) string
	ReadFile func(name string) (buf []byte, err error)

	MinTexRank  int //  2^7
	MaxTexRank  int //  2^12
	MinFontSize int //  2
	MaxFontSize int //  120
	// contains filtered or unexported fields
}

func (*Manager) MakeText

func (man *Manager) MakeText(str string, fontName string, fontSize int) (text *Text, imgs []GlyphImage)

type Text

type Text struct {
	Verts [][4]float32 // x, y, tx, ty
	// contains filtered or unexported fields
}

func (*Text) Close

func (text *Text) Close() error

func (*Text) TextureId

func (text *Text) TextureId() int

Jump to

Keyboard shortcuts

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