pixel: maze.io/x/pixel/pixelfont Index | Files

package pixelfont

import "maze.io/x/pixel/pixelfont"


Package Files

font.go font_glcd_5x8.go util.go


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

Builtin fonts.

type Font Uses

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 Uses

func LoadFont(name string) (Font, error)

func LoadTTFFont Uses

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

func NewFont Uses

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

func NewFontCache Uses

func NewFontCache(font Font) Font

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

func NewTTFFont Uses

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

type TexturedFont Uses

type TexturedFont struct {
    Texture image.Image

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

func (TexturedFont) Glyph Uses

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

Package pixelfont imports 9 packages (graph). Updated 2020-07-15. Refresh now. Tools for package owners.