const1bit

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2025 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package const1bit 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
	// contains filtered or unexported fields
}

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. Since there is only one glyph used for the return value in this package, concurrent access is not allowed. Normally, there is no issue when using it from tinyfont.

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.

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