fonts

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: MIT Imports: 16 Imported by: ? 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 holds giokit's curated font sets, bundled so text renders the same on every machine. Each set is a UI face plus a code face.

th.UseFonts(fonts.Inter())

The font files are embedded in the binary. A program that calls only specific set constructors links only those sets' files; ByName refers to every set, so calling it links them all. Each family is parsed once, on first use (a parsed family costs a few MB of heap, several times its file size), and the parsed faces are shared by every set that includes it. A picker lists Names and loads only the set the user chooses.

All fonts are under the SIL Open Font License 1.1 (OFL.txt beside each).

Index

Constants

This section is empty.

Variables

View Source
var ErrNoSystemFont = errors.New("fonts: no installed font covers the script")

ErrNoSystemFont is returned when no installed font covers the runes.

Functions

func Atkinson

func Atkinson() kit.Fonts

Atkinson is Atkinson Hyperlegible, designed for low-vision readers (distinct letterforms, regular and bold only), with JetBrains Mono.

func ByName

func ByName(name string) (kit.Fonts, bool)

ByName returns the set called name, as stored in Theme.Fonts and tokens. It loads only the families of that set.

func Go

func Go() kit.Fonts

Go is kit's default: Go and Go Mono (no extra files).

func Inter

func Inter() kit.Fonts

Inter is a neutral, highly legible UI sans with JetBrains Mono for code.

func Names

func Names() []string

Names lists every set's name, Go first, for a picker. It loads nothing; pass the chosen name to ByName.

func Plex

func Plex() kit.Fonts

Plex is IBM Plex Sans with IBM Plex Mono: technical, slightly condensed.

func SystemCJK

func SystemCJK() ([]font.FontFace, error)

SystemCJK finds an installed font covering Chinese, Japanese and Korean and returns its regular face. It runs once per process; later calls return the same faces. The first run on a machine indexes the system fonts (seconds; the index is cached in the user cache directory), so call it off the UI goroutine.

func SystemFallback

func SystemFallback(sample []rune, prefer ...string) ([]font.FontFace, error)

SystemFallback finds the installed font that covers every rune of sample and returns its regular face. prefer lists family names, best first, matched without case or spaces; among fonts that match none, a sans-serif regular face wins. The returned face is renamed so it can never be chosen by typeface name, only to fill in runes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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