Documentation
¶
Overview ¶
Package engine connects parsed IR, parsed fonts, and the layout engine.
Index ¶
- Constants
- Variables
- func ValidateStyle(style display.Style) error
- type Engine
- func (e *Engine) Layout(ctx context.Context, root ir.Node, mode ir.Mode, style display.Style) (*display.Box, error)
- func (e *Engine) LayoutFormula(ctx context.Context, formula *ir.Formula, mode ir.Mode, style display.Style) (*display.Box, error)
- func (e *Engine) LayoutParsedFormula(ctx context.Context, formula *ir.Formula, stats ir.Stats, mode ir.Mode, ...) (*display.Box, error)
Constants ¶
const MaxStyleFeatures = 64
Variables ¶
var ErrInvalidInput = errors.New("engine: invalid input")
Functions ¶
func ValidateStyle ¶
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 (*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.