Help us shape the future of Go! Take the 2026 Go Developer Survey

fonts

package
v0.1.1353 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package fonts describes the installed faces a desktop page can choose. It returns names and CSS traits, never font files or their paths.

Index

Constants

View Source
const Available = true

Variables

This section is empty.

Functions

func Validate

func Validate(f *Face) error

Validate also accepts an absent choice, which keeps the platform's stack. Availability is separate: a font removed since it was chosen stays saved.

Types

type Face

type Face struct {
	Family  string  `json:"family"`
	Name    string  `json:"name"`
	Weight  float64 `json:"weight"`
	Style   string  `json:"style"`
	Stretch float64 `json:"stretch"`
}

Face is one installed style. Name is the font's own style name; Style is its CSS slope. Stretch is a percentage, and Weight is an OpenType weight.

type Family

type Family struct {
	Name   string `json:"name"`
	Styles []Face `json:"styles"`
}

func List

func List() ([]Family, error)

List reads a fresh system collection, including fonts installed for just this user. Callers may cache a successful result until the user refreshes.

Jump to

Keyboard shortcuts

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