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
Requirement describes font properties needed by a conversion route.