engine

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: Apache-2.0, MIT Imports: 15 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 engine connects parsed IR, parsed fonts, and the layout engine.

Index

Constants

View Source
const MaxStyleFeatures = 64

Variables

View Source
var ErrInvalidInput = errors.New("engine: invalid input")

Functions

func ValidateStyle

func ValidateStyle(style display.Style) error

ValidateStyle checks layout request values before any engine or provider is entered. Feature syntax is shared with shaping so validation cannot drift.

Types

type Engine

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

Engine is an immutable arrangement of one parsed font set and its layout renderer. It is safe for concurrent Layout calls when the FontSet is safe, which the font package guarantees.

func New

func New(fonts *font.FontSet, limits source.Limits) (*Engine, error)

New constructs an end-to-end layout engine.

func (*Engine) Layout

func (e *Engine) Layout(ctx context.Context, root ir.Node, mode ir.Mode, style display.Style) (*display.Box, error)

Layout lays root out with mode and style.

func (*Engine) LayoutFormula

func (e *Engine) LayoutFormula(ctx context.Context, formula *ir.Formula, mode ir.Mode, style display.Style) (*display.Box, error)

LayoutFormula lays out a complete formula, including formula-scoped metadata.

func (*Engine) LayoutParsedFormula

func (e *Engine) LayoutParsedFormula(ctx context.Context, formula *ir.Formula, stats ir.Stats, mode ir.Mode, style display.Style) (*display.Box, error)

LayoutParsedFormula lays out a formula that was structurally validated and frozen by the parser boundary. It skips repeated structural validation while retaining engine-configured limits and output invariants.

Jump to

Keyboard shortcuts

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