fonts

package
v5.28.2 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Additional fonts over and above what unison provides by default.

Functions

This section is empty.

Types

type Fonts

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

Fonts holds a set of themed fonts.

func NewFromFS

func NewFromFS(fileSystem fs.FS, filePath string) (*Fonts, error)

NewFromFS creates a new set of fonts from a file. Any missing values will be filled in with defaults.

func (*Fonts) MakeCurrent

func (f *Fonts) MakeCurrent()

MakeCurrent applies these fonts to the current theme font set and updates all windows.

func (*Fonts) MarshalJSON

func (f *Fonts) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*Fonts) Reset

func (f *Fonts) Reset()

Reset to factory defaults.

func (*Fonts) ResetOne

func (f *Fonts) ResetOne(id string)

ResetOne resets one font by ID to factory defaults.

func (*Fonts) Save

func (f *Fonts) Save(filePath string) error

Save writes the Fonts to the file as JSON.

func (*Fonts) UnmarshalJSON

func (f *Fonts) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ThemedFont

type ThemedFont struct {
	ID    string
	Title string
	Font  *unison.IndirectFont
}

ThemedFont holds a themed font.

func CurrentFonts

func CurrentFonts() []*ThemedFont

CurrentFonts returns the current theme fonts.

func FactoryFonts

func FactoryFonts() []*ThemedFont

FactoryFonts returns the original theme before any modifications.

Jump to

Keyboard shortcuts

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