Skip to content

Releases: cosmiciron/vmprint

VMPrint 1.4.0 — Mixed Page Geometry

05 May 00:55

Choose a tag to compare

This release gathers the engine work since the last GitHub release into one
public milestone. The headline is mixed page geometry: VMPrint can now resolve
different page sizes and margins within a single document, carry those resolved
dimensions through the layout stream, and render matching PDF media boxes.

Added

  • Document-level page templates: layout.pageTemplates can override page
    size, orientation, and margins by zero-based pageIndex or by selectors such
    as first, odd, even, and all.
  • Mixed-size PDF output: Renderers receive resolved page.width and
    page.height per page, so saved layout streams and direct renders preserve
    odd-sized sheets instead of forcing every page back to the document default.
  • Partial simulation: engine.layout({ stopAtPage }) and lower-level
    simulation options can intentionally stop after an inclusive zero-based page
    prefix, with reports marking the stop reason as page-limit.
  • Flow-friendly engine substrate: The runtime now has stronger hosted-region,
    world-plain, and persistent child-actor behavior, including live mutation paths
    for zone-hosted and story-hosted content.
  • Exclusion assembly and shape work: Added weighted exclusion assemblies,
    compression/generation tooling, circle and ellipse exclusion support, polygon
    carry-over, and a micro-lane policy for controlling tiny wrap lanes.
  • Text and rendering capabilities: Added letter spacing support, CSS/browser
    line-height calculation mode, a contract-level text delegate surface, and
    pre-resolved renderer font handling.
  • Authoring and documentation coverage: Updated the quickstart, AST
    reference, CLI reference, page-control guide, engine README, architecture docs,
    internals guide, docs index, and VMPrint authoring skill for the new page
    geometry and partial simulation surfaces.

Changed

  • Renderer architecture: Refactored rendering around ContextRenderer,
    separating box traversal from context-specific drawing and trimming stale
    renderer surfaces.
  • Engine runtime ownership: Moved more layout subsystems into runtime-owned
    boundaries, tightened session/collaborator coordination, and made capture and
    region identity clearer in the simulation report.
  • Page identity model: Reduced brittle pageIndex * pageHeight assumptions
    by carrying chunk/frontier state more explicitly through checkpoints,
    provenance, redraw, hosted-region settlement, and finalization.
  • Repository and release workflow: Clarified the shared-engine sync workflow,
    contracted the repository around the engine/CLI/docs, and kept companion
    runtime packages external to the CLI bundle.
  • Browser demo evolution: The docs playground gained engine-native selection,
    cross-actor copy, copy-as-Markdown behavior, improved bidi selection
    highlighting, and a richer dashboard-style preview surface.

Fixed

  • Empty trailing page in odd-size documents: The new page-template fixture now
    produces only the intended pages, with no blank page after the second sheet.
  • Deferred total-pages materialization: Finalized page publication now
    exposes deferred header/footer content in page-region summaries.
  • Contained text stability: Fixed contained grapheme overflow, strict
    contained line-box wrapping, contained host-width import, and assembly lane
    caps.
  • Splitting and continuation stability: Fixed constrained-height paragraph
    splitting, hosted-region orphan-limit candidates, spanning-zone recovery,
    table continuation metadata, and zone overlays.
  • Performance regressions: Restored fast paths around ASCII segmentation,
    cached cluster/font resolution, optional interaction-map construction, and
    the temporal presentation collaborator path.
  • Packaging and typings: Refreshed publish-time typings, dual CJS/ESM exports,
    CLI runtime bundling, and packaged integration smoke checks.

VMPrintPreview Takes Center Stage

29 Mar 10:29

Choose a tag to compare

Most JavaScript PDF tools make you choose between two bad options: wrestle with print CSS until it breaks on page 2, or rewire your entire UI in JSX components just to get a rendered document. react-pdf is popular for a reason — it works — but it comes with a cost: a component model wrapped around a layout engine, dependencies all the way down, and no live preview that matches what you'll actually export.

VMPrint was built for the case where that tradeoff stops being acceptable. One layout pass. Live canvas preview. PDF, SVG, or server output — same session, same result. No React. No Chromium. No re-render surprises.

This release makes all of that visible in under ten seconds.


What's New

The preview demo is now the front door.
The VMPrint homepage opens directly into the story, with the live preview demo embedded below it. Type Markdown, see the paginated layout update in real time, export a PDF. That's the pitch, and now it's the first thing you see.

New built-in style presets — Blueprint Atelier and Annual Report
Two new presets that show what publication-grade layout actually looks like out of the box, not just functional defaults.

Better fit-to-page sizing and first-load behavior
The preview now opens correctly sized on first load, and pages fit the viewport without manual adjustment.

Markdown image links now work in the browser demo
Drop an image into your Markdown and it renders in the preview. Edge case, but an important one.

Drop-cap support in the Markdown pipeline
Explicit drop-cap rendering via the transmuter layer.

Stronger social presence
New Open Graph preview image, tightened SEO metadata, and clearer pathways from the homepage to docs, examples, and advanced layout samples.


Why This Release Matters

The documentation has always described what VMPrint can do. This release lets you watch it do it.

If you've spent time fighting react-pdf's component model, or debugging print CSS page breaks at 11pm, VMPrint is worth five minutes of your time. The live demo runs in the browser, static, no install, and the code is right there in the page source.


Try It

VMPrint 1.0 — The Real Thing

23 Mar 06:48

Choose a tag to compare

VMPrint 1.0 — The Real Thing

I have been building toward this moment since the first experimental commits. VMPrint 1.0 is not an incremental update. It is the line in the sand that separates "something interesting is happening here" from "you can build real things with this."


A New Kind of Layout Engine

At the core of VMPrint 1.0 is a ground-up reimagination of how a document layout engine works.

Most layout systems are glorified paginators — they march line by line through a document and hope for the best when things get complicated. VMPrint 1.0 replaces that model with something entirely different: a simulation runtime built around a spatial-temporal model of document layout.

The spatial-temporal layout engine is patent pending.

Instead of a linear pagination loop, the engine now operates as a simulation with explicit phases: placement, collision detection, physics, transitions, and lifecycle dispatch. Documents are settled, not merely paginated. Complex behaviors — keep-with-next, page reservations, column spanning, heading telemetry, nested continuations, live table-of-contents generation — emerge naturally from the simulation substrate rather than being bolted on as special cases.

The result is a layout engine capable of things that simply cannot be expressed in traditional paginators.


This Is the Real Deal

Previous releases were honest technology previews. The architecture was exploratory, the surface area was shifting, and I was candid that it was not yet the foundation you would build a product on.

That changes today.

VMPrint 1.0 is production-ready. The document model (AST 1.1) is stable. The layout contracts are locked. The regression suite covers 26 complex fixtures — multi-column flows, nested tables, nested stories, zone maps, column spans, RTL/bidi, drop caps, floats, live TOC, headers/footers, total-page footers, and more — and every one of them must pass deterministically on every build. You can depend on this.


What's New in 1.0

The Simulation Runtime

The engine was rebuilt around an explicit simulation kernel with collaborator-based coordination. Speculative layout, rollback, and deterministic replay are now first-class capabilities. Simulation reports expose post-layout facts to downstream tooling without leaking engine internals. This is the architecture that makes ambitious documents possible.

Scripting Series 1

Documents can now think. A post-settlement scripting runtime gives document blueprints direct access to lifecycle hooks, element messaging, receiver-oriented mutation, and structural replacement/insertion/deletion flows. Live reactive content — a table of contents that updates as pages reflow, a footer that knows the total page count — is no longer a trick. It is just scripting.

Spatial Layout: Floats, Column Spans, Zone Maps

  • Block-level floats for non-image content inside stories
  • Column spanning via properties.columnSpan — full-width breaks inside multi-column flows, exactly where you want them
  • Zone maps as a first-class layout primitive: bounded side-by-side regions with fully independent strip layout, perfect for sidebars, callouts, and complex editorial compositions

AST 1.1

The document model was upgraded to AST 1.1. onLoad and onCreate now run as a formal blueprint preprocessing phase, before layout settlement begins. All fixtures, transmuters, and tooling have been updated consistently.


Practical Tools, Ready to Use

@vmprint/web-fonts — Browser-First Font Manager

Loading beautiful typography in the browser used to mean fighting CORS, managing fetch timing, and hoping your font cache stayed warm. @vmprint/web-fonts handles all of it — remote font loading, optional persistent caching, and clean integration with the engine's font registration surface. Drop it into any browser-based VMPrint pipeline.

@vmprint/context-canvas — Live Browser Preview

@vmprint/context-canvas builds SVG-backed page scenes and renders them directly into canvas targets. Feed it a Document AST and get a live, pixel-accurate preview of your layout running entirely in the browser — no server, no PDF round-trip, no waiting.


The /docs Examples: Living Proof

The best way to understand what VMPrint 1.0 can do is to see it running. I've included a set of self-contained static examples under /docs/examples that you can open directly in a browser — no build step, no server, no install:

Example What it shows
ast-to-canvas-webfonts Document AST → canvas rendering with remote web fonts
ast-to-pdf-webfonts Document AST → PDF generation with web fonts, in the browser
ast-to-pdf Core AST-to-PDF pipeline, zero dependencies
mkd-to-ast Markdown → VMPrint AST transmutation

These are not toy demos. They are complete, production-weight pipelines running in a static HTML page. Fork them. Strip them down. Build your own renderer on top of them. They are yours.


What You Can Build

VMPrint 1.0 is a foundation. Here is a taste of what it makes possible:

  • Editorial and publishing tools — multi-column magazine layouts, flowing long-form text, drop caps, floats, and rich inline typography
  • Live document editors — canvas preview in the browser, PDF export on demand, fonts loaded remotely or from cache
  • Programmatic document generation — legal filings, technical reports, invoices, books — authored as data and settled by the simulation engine into pixel-perfect pages
  • Reactive documents — scripted live content: auto-generated TOCs, dynamic page counts, content that adapts to its own layout
  • Multilingual typesetting — full Unicode bidi (UAX #9), Arabic shaping, complex scripts, and JIT font loading for CJK and global scripts

Thank You

VMPrint started as a question: what would a layout engine look like if it were designed from first principles for the modern web, without the baggage of decades of pagination assumptions?

Version 1.0 is my answer. I hope it sparks your imagination.


Full technical changelog: CHANGELOG.md

v0.3.1: VMPrint & Draft2Final: fix

12 Mar 07:09

Choose a tag to compare

Highlights

  • Improved RTL support in mixed-language paragraphs, especially Arabic embedded in LTR text.
  • Direction handling is now more robust with paragraph-level direction: auto resolution.
  • Neutral whitespace/punctuation handling in bidi runs was fixed to avoid phrase fragmentation.
  • draft2final bumped to 1.0.2; monorepo bumped to 0.3.1.

What’s Fixed

  • Engine bidi/RTL
  • Hardened paragraph-level direction resolution for mixed LTR/RTL content.
  • Improved neutral run assignment (spaces/punctuation) between strong bidi runs.
  • Neutral whitespace now inherits active script/font run during segmentation, preventing Arabic run splitting and improving visual ordering stability.

Regression/Test updates

  • Added/expanded auto-direction and mixed-bidi coverage:
  • engine/tests/auto-direction.spec.ts
  • engine/tests/module-extractions.spec.ts
  • Refreshed regression layout snapshots to match deterministic output after bidi fixes.

Fixture tooling

  • Fixed regression fixture PDF generator for standard-font fixture:
    • engine/tests/fixtures/regression/generate-fixture-pdfs.mjs
  • 16-standard-fonts-pdf14.json now correctly uses StandardFontManager (fixes Symbol/ZapfDingbats render failure).

Version Bumps

vmprint: 0.3.0 -> 0.3.1
draft2final: 1.0.1 -> 1.0.2

Notes

This release includes broad snapshot updates because mixed-script whitespace/font-run behavior affects line wrapping and pagination across many fixtures.

🚀 VMPrint / Draft2Final 0.3.0: The Global JIT Typesetting Release

09 Mar 05:09

Choose a tag to compare

I am incredibly excited to announce version 0.3.0 of VMPrint and Draft2Final. This release transforms the tooling from a developer-centric layout engine into a highly polished, production-ready, globally aware application for writers and publishers.

Draft2Final is no longer just a wrapper—it is now a zero-dependency, standalone CLI that instantly provides publication-grade PDF compilation.

🌟 Highlights

🌍 Global "Just-In-Time" Typesetting

I built Draft2Final to give developers and writers absolute typographic control without bloat. The biggest challenge with global language support is file size: a full set of high-quality CJK fonts can exceed 60MB.

In 0.3.0, I solved this with the JIT Downloader:

  • Tiny Core: The CLI is now distributed as a standalone 4.4MB binary, bundling only a lightweight "Latin Pack" of core fonts (Caladea, Cousine, Arimo) and PDF metrics for instant offline rendering.
  • Intelligent Pruning: The layout engine deeply analyzes your Document AST before rendering. If it detects Chinese, Japanese, Hebrew, Arabic, Thai, or Indic scripts, it dynamically disables unused fallbacks and only fetches what your document requires.
  • Auto-Downloading: The required scripts are securely downloaded from a high-speed CDN, displayed in the CLI via a buttery-smooth concurrent progress tracker, and permanently cached in your local ~/.vmprint/fonts/ folder.

You get world-class global typography, on-demand, without bloating your hard drive or the repository.

⚡ Zero-Dependency Standalone CLI

Installing Draft2Final is now faster and more reliable than ever. I've replaced the sprawling monorepo NPM dependencies with a single, highly-optimized tsup bundle. It just works.

🏗️ Instant Project Scaffolding

Starting a new book or screenplay? I added an initialization command to get you running immediately without memorizing YAML configs:

draft2final --init my-new-book
cd my-new-book
draft2final document.md --config config.yaml --theme theme.yaml

🛠️ Fixes and Polish

  • Smarter Fallbacks: I fixed an issue where standard English punctuation (like the em-dash) would accidentally trigger the download of 10MB Chinese fonts.
  • Beautiful Terminal Output: Enjoy precise timing reports and a flicker-free concurrent download UI.
  • Lean Open-Source Repo: I extracted 50MB+ of binary fonts from the core repository into a dedicated assets branch, keeping git clone times lightning fast for new contributors.

Install It Today

Global Install (Recommended for frequent use):

npm install -g @draft2final/cli
draft2final --init my-book

Run Instantly via npx (Zero install):

npx @draft2final/cli --init my-book

Write in plaintext. Compile to perfection. Welcome to Draft2Final.

draft2final v1.0.0 — Official Launch

09 Mar 11:12

Choose a tag to compare

✦ Focus on the Writing. Perfection in the Output.

I am proud to announce the official 1.0.0 launch of draft2final -- the very reason this whole project was started. It took a while because I had to take a detour to build the engine first. LOL. But finally, it is here!

This version marks a radical simplification of the CLI experience, removing implementation details and developer jargon in favor of a premium, industrial-strength environment for writers, screenwriters, and researchers.

Key Highlights in 1.0.0:

  • Simplified Vocabulary: Standardized on --as (Form) and --style (Aesthetic) flags.
  • Zero-Friction CLI: Run draft2final story.md with zero flags for professional defaults.
  • Unified Frontmatter: Specify your document's form with a simple as: screenplay key in your Markdown file.
  • Premium UX: A completely redesigned welcome screen and help system for the discerning user.
  • Industrial Accuracy: Powered by our state-of-the-art native typesetting engine (no browser-based hacks).

Installation:

npm install -g draft2final

v0.2.0: Transmuter Architecture Overhaul + New draft2final

08 Mar 16:06

Choose a tag to compare

v0.2.0: Transmuter Architecture Overhaul + New draft2final

This release introduces a major architecture upgrade centered on one idea:

What is a Transmuter?

A Transmuter converts source text (for now, Markdown) into VMPrint’s canonical document model (DocumentInput).

In short:

source -> transmuter -> DocumentInput -> renderer -> PDF

Instead of one monolithic formatter trying to do everything, each transmuter is responsible for interpreting a specific writing intent (academic, literature, manuscript, screenplay, general markdown).

Why this is better

1. Write once, format many ways

You can keep your source in plain Markdown and target different output conventions by swapping transmuters/themes.

2. Clear separation of concerns

  • Transmuters handle semantic interpretation
  • Engine handles deterministic layout/pagination/rendering
  • draft2final handles orchestration (select transmuter, resolve config/theme, output PDF or AST)

This makes the system easier to reason about and extend.

3. Faster feature development

New formats no longer require touching a monolithic compiler path. Transmuters can evolve independently with smaller, safer changes.

4. Better portability and reuse

Shared Markdown compilation now lives in @vmprint/markdown-core, so multiple transmuters can reuse the same robust core behavior.

What shipped in v0.2.0

  • New shared compiler package: @vmprint/markdown-core
  • Refactored @vmprint/transmuter-mkd-mkd into a thin wrapper over markdown-core
  • Standardized transmuter contracts in @vmprint/contracts
  • New transmuter packages:
    • @vmprint/transmuter-mkd-academic
    • @vmprint/transmuter-mkd-literature
    • @vmprint/transmuter-mkd-manuscript
    • @vmprint/transmuter-mkd-screenplay
  • draft2final reworked into a transmuter-first CLI
  • Documentation updates and tutorial/theme additions for onboarding
  • Standard-font measurement/render encoding consistency fix

Who benefits most

  • Writers who want plain-text drafting without format lock-in
  • Screenwriters/directors who need screenplay-style output from lightweight source
  • Academics/students who need clean output while staying focused on content

This release lays the foundation for adding new format targets without reworking the entire pipeline.

v0.1.3: Full Bidi, Tiny Footprint: Arabic + RTL Done Without HarfBuzz!

07 Mar 12:27

Choose a tag to compare

This release is a substantial engine upgrade:

VMPrint now delivers full Unicode bidirectional text handling and materially improved Arabic/RTL rendering while keeping the runtime lean. We added complete UAX #9 bidi processing, improved shaping integration, and stabilized mixed LTR/RTL layout and rendering behavior, all without pulling in HarfBuzz or a heavyweight shaping stack.

The result is better correctness for real multilingual documents without compromising the small, deployable profile that makes VMPrint practical in browser, edge, and constrained environments.

languages-2

v0.1.2: Page Regions, Transmuters, and Embeddable Pipelines

07 Mar 03:02

Choose a tag to compare

[0.1.2] - 2026-03-07

VMPrint 0.1.2 is a substantial release focused on two things: richer document structure and a much more realistic embedded pipeline story. The most visible addition is the new header/footer system. Headers and footers are now first-class page regions with firstPage, odd, even, and default selectors, plus per-page overrides that can suppress or replace a region based on the flow element that lands on that page. That makes real running heads, chapter openers, folios, and publication-style page behavior part of the engine itself rather than something approximated outside it.

This release also marks the introduction of Transmuters, starting with a Markdown transmuter that turns source content into VMPrint DocumentInput. That is an important architectural shift: VMPrint is no longer just a rendering engine and a CLI, but a more complete pipeline where source parsing, semantic transformation, layout, and rendering can be separated cleanly. Alongside that, 0.1.2 adds pure static embedded samples that demonstrate these flows end to end in a self-contained way. They are not just demos; they also serve as practical validation that browser-oriented and embedded VMPrint pipelines are now viable.

The addition of the lightweight PDF context is part of the same story. With context-pdf-lite and the new transmuter layer in place, workflows like Markdown -> VMPrint IR -> PDF can run in environments that are much closer to real embedded usage. That has meaningful implications for documentation, integration testing, downstream tooling, and future applications that want to use VMPrint as a programmable typesetting runtime rather than only as a command-line compiler.

Highlights

  • New header/footer page-region system with firstPage, odd, even, and default selectors
  • Per-page header/footer overrides and logical/physical page-number token support
  • New @vmprint/transmuter-mkd Markdown transmuter
  • New @vmprint/context-pdf-lite lightweight PDF context
  • New static embedded pipeline samples for AST -> PDF and Markdown -> AST
  • New markdown novel theme
  • Regression coverage and snapshot updates for the new region model

Added

@vmprint/context-pdf-lite

A lightweight PDF rendering context powered by jsPDF for embeddable and browser-friendly PDF output.

  • New contexts/pdf-lite package
  • Packaged integration coverage for the built engine + standard fonts + pdf-lite stack
  • Root build now includes the pdf-lite workspace

Browser Documentation Examples

  • New self-contained static AST-to-PDF showcase under docs/examples/ast-to-pdf/
  • New self-contained static Markdown-to-AST showcase under docs/examples/mkd-to-ast/
  • Example bundling/build pipeline added under scripts/build-docs-examples.mjs
  • docs/README.md and example landing pages expanded to cover the static demos

Markdown Transmuter

  • New @vmprint/transmuter-mkd package for converting Markdown into VMPrint DocumentInput
  • Theme-aware transmutation with bundled default, novel, and opensource themes
  • New transmuter documentation under transmuters/README.md and transmuters/mkd-mkd/README.md

Header and Footer Page Regions

  • New top-level header / footer document regions with default, firstPage, odd, and even selectors
  • New per-element pageOverrides for page-local header/footer replacement or suppression
  • New physical/logical page-number token substitution in region content
  • New engine regression fixture and design docs for page-region behavior

Markdown Novel Theme

  • New novel theme for draft2final markdown output
  • Matching bundled novel theme for the Markdown transmuter
  • New layout snapshot coverage for the markdown novel sample

Changed

Engine Rendering and Layout

  • Rich inline baseline alignment and rendering metrics were tightened engine-wide
  • Renderer and debug drawing paths were updated to match the new rich-line metrics flow
  • Header/footer geometry now lives inside page margins rather than spanning the full page width
  • Region content is laid out under a region-local, non-paginating context and clipped to the available margin box

draft2final

  • Theme loading now supports document-level header / footer definitions in addition to layout and styles
  • Markdown themes were updated to use page-region-driven folios instead of the old flat page-number settings
  • Test fixtures and layout snapshots were expanded for the new region model

Fixed

  • @vmprint/transmuter-mkd build breakage in the bundled novel theme source
  • Packaged integration flow after a clean root build by ensuring pdf-lite artifacts are generated
  • Header/footer regression fixtures and assertions so they validate the intended margin-bounded region model

v0.1.1 - Multi-Column Layouts, Zero-Byte Fonts, & Manuscript Format

05 Mar 08:32

Choose a tag to compare

Added

StandardFontManager (@vmprint/standard-fonts)

A zero-asset FontManager that supports all 14 PDF standard fonts without requiring any font files to be installed or bundled.

  • New @vmprint/font-managers/standard package with StandardFontManager
  • Alias table covering all 14 standard fonts plus metric-compatible families: Arimo, Tinos, Cousine, Carlito, Caladea, Noto Sans, and Courier Prime
  • Engine: sentinel detection in the font cache loader; AfmFontProxy backed by static AFM metric tables (generated from PDFKit's .afm files); per-glyph advance widths and bounding boxes
  • AFM tables keyed by Unicode codepoint (not Adobe Standard Encoding) so extended characters — en-dash, em-dash, smart quotes, etc. — resolve correctly
  • contexts/pdf: suppresses font embedding for standard fonts and passes the PostScript name directly to PDFKit using WinAnsiEncoding
  • font-managers/local: added Symbol and ZapfDingbats aliases pointing to Noto Sans Symbols 2
  • Architecture documentation: documents/STANDARD-FONTS.md

Multi-Column Layouts

  • Story packager extended with full multi-column layout support
  • Column count, gutter width, and per-column flow are driven by the existing engine document model
  • New engine regression test and fixture: 15-story-multi-column

Manuscript Format (draft2final)

  • New industry-compliant manuscript format for draft2final with two themes: default and classic
  • Smart quotes and smart dashes applied automatically within manuscript documents
  • Manuscript format includes its own config defaults, validator, and theme YAML files
  • New layout snapshot fixtures: manuscript-layout-sample and manuscript-classic-layout-sample
  • draft2final/MANUSCRIPT.md — authoring and format reference

VmprintOutputStream contract

  • New VmprintOutputStream interface in @vmprint/contracts: a portable write / end / waitForFinish abstraction that callers implement against their own I/O transport
  • Context contract now requires a pipe(stream: VmprintOutputStream): void method; no-op implementations are explicitly allowed for contexts that manage their own output
  • NodeWriteStreamAdapter added in CLI and draft2final to bridge Node.js fs.WriteStream into VmprintOutputStream, keeping filesystem I/O in the caller

Changed

draft2final Architecture Overhaul

The draft2final package was substantially restructured to make creating new formats straightforward and reduce per-format boilerplate.

  • "Flavor" renamed to "Theme" throughout the codebase — themes are now the canonical term for format variants
  • Each format (academic, literature, markdown, screenplay) was extracted from a monolithic index file into a dedicated format.ts module with a config.defaults.yaml and a themes/ directory containing per-theme YAML
  • New shared compiler infrastructure under draft2final/src/formats/compiler/:
    • compile.ts — orchestrates format compilation
    • config-resolver.ts — resolves layered configuration (defaults → theme → user overrides)
    • format-context.ts — shared format rendering context
    • format-handler.ts — base handler interface
    • inline.ts — shared inline element compilation
    • image.ts — image handling utilities
    • numbering.ts — numbering utilities
    • theme-loader.ts — theme YAML loading
    • markdown-base-format.ts — shared base for Markdown-derived formats
    • rule-based-handler.ts — declarative rule-based element dispatcher
  • build.ts and cli.ts updated to use the new format registry
  • format-loader.ts (previously flavor-loader.ts) removed in favour of the new formats/index.ts registry

Additive Margins

Margin behaviour changed from collapsing to additive across the engine and all draft2final formats.

  • Adjacent block margins now sum rather than collapse, matching standard typesetting conventions
  • All draft2final format themes (academic, literature, markdown, screenplay) updated with recalibrated margin values
  • All layout snapshot fixtures regenerated to reflect the new behaviour
  • Engine: paginate-packagers.ts updated with the new margin accumulation logic

Removed Variable Font Support

Variable font (.wdf / wght-axis) support has been removed from the engine and context to simplify font handling and make writing new contexts easier.

  • Engine: variable-font axis resolution removed from layout-utils.ts, text-processor.ts, and font-registration.ts
  • contexts/pdf: variable font subsetting code removed; fontkit.d.ts shim removed; pdfkit-fontkit dependency dropped
  • font-managers/local: variable font assets (ArimoVariable) replaced with four static TTF files (Regular, Bold, Italic, BoldItalic)
  • contracts: FontManager interface simplified — variable-font fields removed
  • Engine font-management ops simplified accordingly

CLI: Removed --context flag

The --context flag has been removed from the CLI.

  • The flag's pluggability was illusory: the undocumented two-argument constructor made third-party contexts non-functional
  • The CLI is now an honest PDF tool; PdfContext is used directly
  • PdfContext constructor simplified to (options: ContextFactoryOptions) only; pipe() now bridges via PDFKit's data/end events into VmprintOutputStream instead of accepting a Node.js stream directly
  • CLI's --font-manager flag resolution fixed: bare package names are resolved via require.resolve; file paths via path.resolve

Fixed

  • Superscript rendering in the engine (engine/src/engine/layout/text-wrap-core.ts, rich-line-draw.ts)
  • AFM proxy glyphForCodePoint now does a direct Unicode lookup, removing the intermediate WIN_ANSI_CODE_MAP that caused extended characters to resolve incorrectly

Reorganized

  • samples/ directory restructured for discoverability:
    • samples/draft2final/source/ — source documents grouped by format
    • samples/engine/tests/ — all engine regression PDFs
    • samples/overlay/ — overlay pipeline outputs
  • documents/readme-assets/ — README images and hero assets moved out of documents/readme/
  • Removed stale documents/ROADMAP.md and documents/PERFORMANCE_OPTIMIZATION_LOG.md