fixture

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package fixture builds the sample document used by tests and demos.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Demo

func Demo() (*bdf.Document, error)

Demo builds a document with a slide deck, a flow document and a sheet.

Types

type Fonts

type Fonts struct {
	Regular, Bold       bdf.Hash
	RegularM, BoldM     *Measurer
	RegularRef, BoldRef bdf.Font
}

Fonts holds the embedded fixture fonts.

func LoadFonts

func LoadFonts(d *bdf.Document) (*Fonts, error)

LoadFonts adds the fixture fonts to d.

type Measurer

type Measurer struct {
	// contains filtered or unexported fields
}

Measurer computes text advances from an sfnt font.

func NewMeasurer

func NewMeasurer(data []byte) (*Measurer, error)

NewMeasurer parses a TTF/OTF.

func (*Measurer) Advance

func (m *Measurer) Advance(s string, size float32) float32

Advance returns the width of s at the given size in units (no kerning).

Jump to

Keyboard shortcuts

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