einkfs

package
v0.0.0-...-83670e0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: BSD-3-Clause Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendFallbackFonts

func AppendFallbackFonts(names []string) []string

func NewFS

func NewFS(dev EinkDevice, mkimg func(r image.Rectangle) draw.Image, logger *log.Logger, fset FontSet, rotation int) ninep.FileSystem

func NewImage1bitVerticalLSB

func NewImage1bitVerticalLSB(r image.Rectangle) draw.Image

func NewWaveshare2in13v2FS

func NewWaveshare2in13v2FS(fset FontSet, logger *log.Logger, rotation int) (f ninep.FileSystem, close func(), err error)

Types

type EinkDevice

type EinkDevice interface {
	Draw(dstRect image.Rectangle, src image.Image, srcPts image.Point) error
	Bounds() image.Rectangle
	Clear(color.Color) error
}

func NewNullEinkDevice

func NewNullEinkDevice(size image.Point) EinkDevice

type FontSet

type FontSet struct {
	Faces       []font.Face
	Fonts       []*sfnt.Font
	Collections []*sfnt.Collection
	Names       []string

	Options *opentype.FaceOptions
}

func LoadFonts

func LoadFonts(f fs.FS, names []string, opt *opentype.FaceOptions) FontSet

LoadFonts loads a set of named fonts from the given file system. The fonts are used in order to render to text based on each font's available glyphs.

Any invalid fonts are silently ignored.

func (FontSet) RenderText

func (s FontSet) RenderText(dst draw.Image, text string, start func(font.Metrics) fixed.Point26_6)

RenderText renders the given text to the destination image using the loaded fonts. The start function is used to determine the starting point for the text.

func (*FontSet) Reset

func (s *FontSet) Reset(opts *opentype.FaceOptions)

type NullEinkDevice

type NullEinkDevice struct {
	B image.Rectangle
}

func (NullEinkDevice) Bounds

func (d NullEinkDevice) Bounds() image.Rectangle

func (NullEinkDevice) Clear

func (d NullEinkDevice) Clear(color.Color) error

func (NullEinkDevice) Draw

func (d NullEinkDevice) Draw(dstRect image.Rectangle, src image.Image, srcPts image.Point) error

Jump to

Keyboard shortcuts

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