fonts

package
v0.1.4921 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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