# bramstein/typeset

TeX line breaking algorithm in JavaScript

Repository: https://github.com/bramstein/typeset
Canonical: https://ross.abutalabs.com/products/bramstein-typeset
Language: JavaScript
License: BSD-2-Clause
License Family: permissive
Last push: 2026-06-20T08:15:01+00:00

## Health v2 (maintenance only)
Score: 72/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 88, release rhythm 35, longevity 100
- inputs: {"age_days": 5399, "days_push": 74, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1037, forks 72 (observed 2026-08-28T04:03:19.439607+00:00)

## What it is
A JavaScript implementation of the Knuth and Plass (TeX) line breaking algorithm for optimally setting justified text in the browser. It provides better line breaks than native browser text justification by minimizing inter-word spacing across all lines.

## Use cases
- improve justified text quality in the browser
- implement TeX-quality line breaking in JavaScript
- reduce rivers and uneven word spacing in paragraphs
- compare browser line breaks against optimal Knuth-Plass breaks
- correct browser line breaks via word-spacing adjustments
- build high-quality typesetting tools for the web

## When to avoid
- you only need simple left-aligned or ragged-right text
- you need a full page layout or typesetting engine
- your project cannot tolerate DOM manipulation for line measurement

## Facets
- artifact type: library
- maturity: maintenance
- function: templating, graphics
- domain: web-development, frontend
- platform: browser
- tags: typography, line-breaking, knuth-plass, text-layout, justified-text, algorithms, javascript

## Member repositories
- bramstein/typeset (main) score 72

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:19.439607+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:04:22.346679+00:00, confidence not recorded.
  - readme: https://github.com/bramstein/typeset (fetched 2026-08-28T04:03:19.439607+00:00, sha a18284468bc5)
- Data as of 2026-08-30T08:39:29.467469+00:00.
