const2bit

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2023 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package const2bit is for fonts that use 2 bits per pixel.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Font

type Font struct {
	BBox     [4]int8 // width, height, minX, minY
	Glyphs   []Glyph
	YAdvance uint8

	OffsetMap string
	Data      string
	Name      string
}

Font is a struct that implements Fonter interface.

func (*Font) GetGlyph

func (font *Font) GetGlyph(r rune) tinyfont.Glypher

GetGlyph returns the glyph corresponding to the specified rune in the font.

func (*Font) GetYAdvance

func (f *Font) GetYAdvance() uint8

GetYAdvance returns YAdvance of f.

type Glyph

type Glyph struct {
	Rune     rune
	Width    uint8
	Height   uint8
	XAdvance uint8
	XOffset  int8
	YOffset  int8
	Bitmaps  []byte
}

Glyph is a struct that implements Glypher interface.

func (Glyph) Draw

func (glyph Glyph) Draw(display drivers.Displayer, x int16, y int16, c color.RGBA)

Draw sets a single glyph in the buffer of the display. TODO: allow the user to set the color

func (Glyph) Info

func (glyph Glyph) Info() tinyfont.GlyphInfo

Info returns glyph information.

Jump to

Keyboard shortcuts

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