fonts

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: MIT Imports: 16 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 detects installed Nerd Fonts and installs the official NerdFontsSymbolsOnly fallback font (plus Linux fontconfig fallback rules) on Linux, macOS, and Windows.

Index

Constants

View Source
const SymbolsFontArchiveURL = "https://github.com/ryanoasis/nerd-fonts/releases/latest/download/NerdFontsSymbolsOnly.zip"

SymbolsFontArchiveURL is the official Nerd Fonts Symbols-Only release archive. Installing it adds Nerd Font glyphs as a system fallback without changing the user's primary font.

Variables

This section is empty.

Functions

func HasNerdFont

func HasNerdFont() bool

HasNerdFont reports whether the current terminal environment is ready to render Nerd Font glyphs out of the box.

func IsSymbolsFontInstalled

func IsSymbolsFontInstalled() bool

IsSymbolsFontInstalled reports whether Symbols Nerd Font files are already present on disk.

func LinuxFontconfigPath

func LinuxFontconfigPath() (string, error)

LinuxFontconfigPath returns the user fontconfig conf.d path for Nerd Font symbol fallback.

func UserFontDir

func UserFontDir() (string, error)

UserFontDir returns the per-user font installation directory for the current OS.

Types

type InstallResult

type InstallResult struct {
	Dir                string   `json:"dir"`
	Files              []string `json:"files"`
	FontconfigPath     string   `json:"fontconfig_path,omitempty"`
	TerminalConfigPath string   `json:"terminal_config_path,omitempty"`
	CacheUpdated       bool     `json:"cache_updated"`
	NeedsRestart       bool     `json:"needs_restart"`
}

InstallResult summarizes the outcome of a Symbols Nerd Font installation.

func InstallSymbolsNerdFont

func InstallSymbolsNerdFont(ctx context.Context) (InstallResult, error)

InstallSymbolsNerdFont downloads and installs the official NerdFontsSymbolsOnly fallback font (and Linux fontconfig fallback rule) into the user's font directory.

func InstallSymbolsNerdFontFrom

func InstallSymbolsNerdFontFrom(ctx context.Context, archiveURL, destDir string, httpClient *http.Client) (InstallResult, error)

InstallSymbolsNerdFontFrom downloads a Nerd Fonts zip archive from archiveURL and extracts its .ttf/.otf files into destDir (defaulting to UserFontDir).

Jump to

Keyboard shortcuts

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