Search by

coolms / document-fonts

The document font set CoolMS ships: 24 metric-compatible faces and the manifest that names them. Fonts only -- no PHP, no autoloader. The layout engine that reads them is TypeScript and lives on npm as @coolms/document-engine, from this same repository.

Maintainers

Package info

github.com/coolms/document-engine

Language:TypeScript

pkg:composer/coolms/document-fonts

Transparency log

Statistics

Installs: 1

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0-alpha.3 2026-09-03 22:48 UTC

This package is auto-updated.

Last update: 2026-09-03 22:56:12 UTC


README

Reading this from Packagist? This repository publishes twice. The TypeScript engine below is the npm package. What Composer installs is coolms/document-fonts: the 24 font files in assets/fonts and the manifest that names them, with no PHP and no autoloader. It exists so a PHP application can reach the same fonts, from the same version, without a Node toolchain. If you are looking for a document layout library for PHP, this is not one.

CI npm Packagist Node License

Framework-agnostic vanilla TypeScript document layout engine: OOXML model, deterministic text measurement from font files, and pagination with reflow. Zero runtime dependencies — the arithmetic is ours, so the browser and the server agree by construction.

Why it has no dependencies

The engine decides where a line breaks and where a page ends. If that arithmetic came from a library, the browser and the server would each get whatever version they resolved, and a document would paginate one way in the editor and another way in the PDF. Owning the arithmetic is what makes the two agree by construction, so the absence of dependencies is the feature rather than an economy.

Text measurement reads the font files in assets/fonts directly -- the metrics come from the same faces the renderer uses, not from a table that can drift away from them.

Install

The engine, from npm:

npm install @coolms/document-engine

The fonts, from Packagist:

composer require coolms/document-fonts

That gives you vendor/coolms/document-fonts/assets/fonts/ -- the 24 faces and fonts.manifest.json. Serve them at whatever URL your application uses; CoolMS serves them under the admin at assets/document-fonts/.

import { ... } from '@coolms/document-engine';

Scripts

npm run build tsc -p tsconfig.build.json
npm run test vitest run
npm run test:watch vitest
npm run typecheck tsc --noEmit
npm run audit:claims node tools/audit-claims.mjs

Requirements

npm: Node >=20. No runtime dependencies; TypeScript and vitest are dev-only.

Composer: none. The package declares no PHP constraint because it contains no PHP -- it is font files and a JSON manifest, and constraining a runtime it never invokes would refuse installations for no reason.

Branches

develop is the default and where work lands; main carries releases. The package is a pre-release and carries no compatibility promise.

Licence

MIT — see LICENSE, which covers this package's own code.

The font files under assets/fonts are third-party and carry their own terms. assets/fonts/fonts.manifest.json records where each one came from: Liberation, Carlito and Caladea were extracted from the gotenberg/gotenberg:8 image (Debian packages fonts-liberation, fonts-crosextra-carlito, fonts-crosextra-caladea), and Gelasio came from the designer's own repository under OFL-1.1. They are vendored rather than installed because the browser and the renderer must shape text from the same bytes or the page boundaries diverge.