fontrepository

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package fontrepository implements font repository.

Index

Constants

This section is empty.

Variables

View Source
var ErrCannotReadFile = errors.New("cannot read file")

Functions

This section is empty.

Types

type FontRepository

type FontRepository struct {
	// contains filtered or unexported fields
}

FontRepository manages custom fonts to be loaded into a document.

func (*FontRepository) AddUTF8Font

func (r *FontRepository) AddUTF8Font(family string, style fontstyle.Type, file string) Repository

AddUTF8Font adds a custom font to the repository.

func (*FontRepository) AddUTF8FontFromBytes

func (r *FontRepository) AddUTF8FontFromBytes(family string, style fontstyle.Type, bytes []byte) Repository

AddUTF8FontFromBytes adds a custom font to the repository from a byte slice.

func (*FontRepository) Load

func (r *FontRepository) Load() ([]entity.CustomFont, error)

Load loads all custom fonts, reading file contents from disk where needed.

type Repository

type Repository interface {
	AddUTF8Font(family string, style fontstyle.Type, file string) Repository
	AddUTF8FontFromBytes(family string, style fontstyle.Type, bytes []byte) Repository
	Load() ([]entity.CustomFont, error)
}

Repository is the abstraction to load custom fonts.

func New

func New() Repository

New creates a new Repository.

Jump to

Keyboard shortcuts

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