PAR

v0.1.0 · MIT · zero dependencies

ASS subtitles, drawn by the browser.

PAR renders .ass / .ssa in plain DOM, SVG and CSS. No WebAssembly, no framework, about 22 kB gzipped.

npm install pulsar-ass-renderer
Live: rendered by PAR right now

What you get

PAR vs JASSUB vs libass

How browser-native TypeScript compares with WebAssembly ports and desktop reference libraries.

Dimension
PAR Pure Web
JASSUB WASM Port
libass Desktop Reference
Architecture / Runtime Pure TypeScript / ESM (DOM, SVG & Canvas2D Worker) WebAssembly + Canvas (C libass compiled via Emscripten) Native C / C++ (Desktop binary: mpv, VLC, Aegisub)
Bundle Size / Download ~35 KB gzipped (Zero dependencies) ~2.5–5 MB (WASM binary + HarfBuzz + FreeType) N/A (Embedded desktop system library)
Startup Time <10 ms instant (Zero compile, instantaneous first frame) 300–800 ms (Network download & WASM compilation) <5 ms (Native desktop execution)
Text Rendering & Scaling Sharp HiDPI/Retina SVG & Canvas (Crisp at any zoom) Fixed raster canvas (Bitmap scaling, prone to blur) Direct raster (Native glyph compositing)
Selectable Text & A11y Yes in DOM (Screen readers, copy/paste, text search) No (Opaque canvas pixels) No (Video overlay pixels)
Memory & Mobile Low heap, battery-friendly (Browser-managed GC) Heavy WASM heap (64MB+ allocated linear memory) N/A (Native OS memory management)
ASS Quirks Parity High web parity with dual engine (Dialogue + Worker) 100% C parity (Direct execution of libass) Reference implementation (De facto standard)

Frametimes & Stutter-Free Playback

Web video playback demands consistent 16.6ms (60 fps) presentation. Passing multi-megabyte frame buffers between WebAssembly workers and the main thread induces latency and micro-stutter. PAR renders standard dialogue directly via CSS transforms and offloads heavy drawings, keeping frametimes rock solid.

The Hidden Cost of WebAssembly

JASSUB packages libass, HarfBuzz, and FreeType into a 2.5–5 MB WebAssembly binary. On mobile connections, downloading and compiling this payload causes visible startup delays and locks 64MB+ of linear heap memory, impacting device battery life.

PAR’s Dual-Path Web Architecture

Engineered specifically for web browsers: dialogue lines render in native DOM/SVG with crisp subpixel antialiasing and full accessibility. Complex drawings, clips, and transforms seamlessly route to an offscreen Canvas2D worker pool. You get instant load times, sharp text, and zero dependencies.

Docs

Install

npm install pulsar-ass-renderer
<script src="https://unpkg.com/pulsar-ass-renderer/dist/par.global.js"></script>

Use

import { create } from 'pulsar-ass-renderer';
const par = create({
  video: document.querySelector('video'),
  subtitle: assText,
});