Skip to content

cosmiciron/vmprint-contexts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VMPrint Contexts

Standard rendering contexts for the VMPrint layout engine.

Rendering contexts are the output surface for VMPrint. The engine produces a Page[] — a stream of absolute layout data — and a context is what those pages are painted onto. This architecture ensures that the same document can be rendered to PDF, SVG, or an HTML Canvas with identical typesetting.

Context Packages

Package Purpose Technology
@vmprint/context-pdf Production PDF PDFKit
@vmprint/context-canvas Browser Preview SVG-backed Canvas
@vmprint/context-pdf-lite Lightweight PDF jsPDF

Development

This repository is a monorepo using npm workspaces.

Installation

npm install

Building

Build all contexts in dual-mode (ESM and CJS):

npm run build

The output artifacts will be placed in the dist/ directory of each package.

Architecture

Every context implements the standard Context interface defined in @vmprint/contracts. A context should contain zero layout logic; its only responsibility is to execute drawing commands (lines, shapes, text, images) against its target medium.

Standard PDF Fonts

The @vmprint/context-pdf implementation includes built-in metrics and encoding logic for the 14 standard PDF fonts (Helvetica, Times, Courier, etc.), making it fully independent of external font managers for standard text rendering.

License

Apache-2.0

About

Official rendering implementations for VMPrint layout engine. Provides production-grade PDF and Canvas output targets. Part of the VMPrint ecosystem: https://github.com/cosmiciron/vmprint

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors