pixelfont

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GLCD5x8 = NewFont(5, 8, fontGLCD5x8)
)

Builtin fonts.

Functions

This section is empty.

Types

type Font

type Font interface {
	// Glyph returns the image mask for the requested glyph.
	Glyph(r rune) image.Image

	// Bounds is the bounding box that fits any glyph in the font.
	Bounds() image.Rectangle
}

Font can render glyph images.

func LoadFont

func LoadFont(name string) (Font, error)

func LoadTTFFont

func LoadTTFFont(name string, size int) (Font, error)

func NewFont

func NewFont(w, h int, pix []byte) Font

func NewFontCache

func NewFontCache(font Font) Font

NewFontCache is a helper that caches all rendered glyphs in memory.

func NewTTFFont

func NewTTFFont(ttf []byte, size int) (Font, error)

type TexturedFont

type TexturedFont struct {
	Font
	Texture image.Image
}

TexturedFont applies a texture to font bitmaps in the output glyph.

func (TexturedFont) Glyph

func (f TexturedFont) Glyph(r rune) image.Image

Jump to

Keyboard shortcuts

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