fonts

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package fonts defines the font preferences consumed by PDF-producing backends.

The package lives outside of both `config` and `backend` to avoid an import cycle: backends import fonts to render PDFs with sensible defaults, while config embeds fonts.Config to let users override those defaults.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Mainfont string `toml:"mainfont"`
	Monofont string `toml:"monofont"`
	Sansfont string `toml:"sansfont"`
}

Config holds font family preferences. Empty fields mean "use backend default".

func Default

func Default() Config

Default returns the platform-appropriate font set.

Values are chosen to be present out-of-the-box on each OS: PT Serif and Menlo ship with macOS; DejaVu is installed by default on most Linux distributions; Times New Roman and Consolas are standard on Windows.

func Resolve added in v0.1.2

func Resolve(req Requirement, cfg Config) (Config, []string)

Resolve returns font settings for req while preserving explicit user config.

func ResolveWithInstalled added in v0.1.2

func ResolveWithInstalled(req Requirement, cfg Config, installed []string) (Config, []string)

ResolveWithInstalled resolves fonts against a deterministic installed list.

type Requirement added in v0.1.2

type Requirement struct {
	NeedCyrillic bool
	NeedMono     bool
}

Requirement describes font properties needed by a conversion route.

Jump to

Keyboard shortcuts

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