Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## [0.5.0] - 2026-02-02

### Changed

- License changed from AGPL-3.0 to MIT

### Breaking changes

- Removed hyphenation patterns for Czech, Indonesian, Macedonian, and Serbian due to incompatible licensing

## [0.4.8] - 2026-02-03

### Changed
Expand Down
665 changes: 5 additions & 660 deletions LICENSE

Large diffs are not rendered by default.

64 changes: 15 additions & 49 deletions LICENSE_THIRD_PARTY
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
This document details the licenses of third-party software used in this project.

The `three-text` library is licensed under the AGPL-3.0-or-later.
The `three-text` library is licensed under the MIT License.

This software incorporates code from several third-party projects. The original
copyright notices and license terms for these projects are detailed below.
Expand Down Expand Up @@ -41,8 +41,8 @@ The software is licensed under the SGI Free Software License B, Version 2.0
3. TeX Hyphenation Patterns

The hyphenation patterns are derived from the TeX hyphenation pattern files,
and are distributed under a variety of licenses. The copyright notices and
licenses for the patterns used in this project are listed below.
and are distributed under a variety of permissive licenses. The copyright
notices and licenses for the patterns included in this project are listed below.

Copyright (C) 1986, 1988, 1989 Kauko Saarinen (fi)
Copyright (C) 1987-1995 Hanna Kołodziejska, Bogusław Jackowski, Marek Ryćko (pl)
Expand All @@ -65,61 +65,48 @@ licenses for the patterns used in this project are listed below.
Copyright (C) 2004-2005 Janis Vilims (lv)
Copyright (C) 2004-2015 Enn Saar (et)
Copyright (C) 2004-2015 Kevin P. Scannell (ga)
Copyright (C) 2004-2007 Rune Kleveland, Ole Michael Selberg, Karl Ove Hufthammer (nb, nn, no)
Copyright (C) 2004—2010 Claudio Beccari (cop)
Copyright (C) 2004-2007 Rune Kleveland, Ole Michael Selberg, Karl Ove Hufthammer (nb, nn)
Copyright (C) 2006, 2007, 2008, 2010 Javier A. Múgica (gl)
Copyright (C) 2008-2011 Claudio Beccari (it)
Copyright (C) 2008-2011 Dimitrios Filippou (el-monoton, el-polyton)
Copyright (C) 2008-2016 Dimitrios Filippou (grc)
Copyright (C) 2010-2015 Nazar Annagurban (tk)
Copyright (C) 2011, 2016 Arthur Reutenauer (mul-ethi)
Copyright (C) 2012 Claudio Beccari (fur)
Copyright (C) 2012 Claudio Beccari, 2024 far.ch (rm)
Copyright (C) 2013 Claudio Beccari (pms)
Copyright (C) 2013 Levan Shoshiashvili (ka)
Copyright (C) 2013 Tilla Fick and Chris Swanepoel (af)
Copyright (c) 2013-2024 Deutschsprachige Trennmustermannschaft (de-1901, de-1996, de-ch-1901)
Copyright (c) 2013-2024 Deutschsprachige Trennmustermannschaft (de-1996)
Copyright (C) 2016 Claudio Beccari (oc)
Copyright (C) 2016 Maksim Salau (be)
Copyright (C) 2016 Santhosh Thottingal (as, bn, gu, hi, kn, ml, mr, or, pa, ta, te)
Copyright (C) 2016-2019 Claudio Beccari, Elie Roux (la-x-liturgic)
Copyright (C) 2018 Wie-Ming Cittānurakkho Bhikkhu (pi)
Copyright (C) 2019 Keno Wehr (la-x-classic)
Copyright (C) 2020 Teemu Likonen, Arthur Rosendahl (fi-x-school)
Copyright (C) Arthur Rosendahl 2018, 2025 (ar, fa, he, vi)
Copyright (C) 1987 Pierre A. MacKay, 2008, 2011 TUG (tr): LPPL
Copyright (C) 1988, 2004 Jörgen Pind (is): LPPL
Copyright (C) 1989-2005 Peter Kleiweg (ia): LPPL
Copyright (C) 1990-2003 Dejan Muhamedagić, Aleksandar Jelenak (sr-cyrl): GPL
Copyright (C) 1990, 2008 Dejan Muhamedagić (sh-cyrl, sh-latn): LPPL
Copyright (C) 1992 Jana Chlebíková (sk): GPL
Copyright (C) 1995 Pavel Ševeček (cs): GPL
Copyright (C) 1995-1996 Adrian Rezus (ro): distributed via tex-hyphen project
Copyright (C) 1996, 1997 Jörg Knappen, Terry Mart (id): GPL
Copyright (C) 1992 Jana Chlebíková (sk): author permission granted
Copyright (C) 1995-1996 Adrian Rezus (ro): permissive
Copyright (C) 1997 Eduard Werner (hsb): LPPL
Copyright (C) 1999 Oliver Corff, Dorjpalam Dorj (mn-cyrl-x-lmc): distributed via tex-hyphen project
Copyright (C) 1999 Oliver Corff, Dorjpalam Dorj (mn-cyrl): permissive
Copyright (C) 1999 Sergei B. Pokrovsky (eo): LPPL 1.0+
Copyright (C) 1999-2003 Alexander I. Lebedev (ru): LPPL
Copyright (C) 2003 Bence Nagy (hu): MPL 1.1 / GPLv2 / LGPLv2.1
Copyright (C) 2006 Vasil Taneski (mk): LPPL 1.3a+
Copyright (C) 2006-2011 Yves Codet (sa): distributed via tex-hyphen project
Copyright (C) 2003 Bence Nagy (hu): MPL 1.1 / LGPLv2.1
Copyright (C) 2006-2011 Yves Codet (sa): permissive
Copyright (C) 2009 Jörg Knappen, Medeni Shemdê (kmr): LPPL 1.3c+
Copyright (C) 2010 Sahak Petrosyan (hy): LGPL
Copyright (C) 2012-2013 Theppitak Karoonboonyanan (th): LPPL
Copyright (C) 2016 Aleksandr Andreev, Mike Kroutikov (cu): GPLv3+
Copyright (C) December 1991-January 1995, July 2003 Gonçal Badenes (ca): LPPL

The following notice applies to patterns distributed under the MIT License. For
other licenses (LPPL, GPL, LGPL, MPL), the full license texts are provided in
the appendices below, or refer to the original license text in the relevant
hyphenation files.
The hyphenation pattern files themselves contain the specific copyright notices
and license information for each language. See the tex-hyphen project for
complete source and licensing details: https://github.com/hyphenation/tex-hyphen

---

Appendix A: MIT License text

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the Software), to deal
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
Expand All @@ -140,14 +127,8 @@ THE SOFTWARE.

Appendix B: Apache License 2.0

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

For the most recent Apache License 2.0 text, see: https://www.apache.org/licenses/LICENSE-2.0



Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Expand Down Expand Up @@ -323,22 +304,7 @@ For the most recent Apache License 2.0 text, see: https://www.apache.org/license
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.


---

Appendix B-2: Hyphenation Pattern Licenses

For hyphenation patterns distributed under GPL, LGPL, LPPL, and MPL, the full
license texts can be found at:

GNU General Public License (GPL): https://www.gnu.org/licenses/gpl.html
GNU Lesser General Public License (LGPL): https://www.gnu.org/licenses/lgpl.html
LaTeX Project Public License (LPPL): https://www.latex-project.org/lppl/
Mozilla Public License (MPL): https://www.mozilla.org/en-US/MPL/

The hyphenation pattern files themselves contain the specific copyright notices
and license information for each language. See the tex-hyphen project for
complete source and licensing details: https://github.com/hyphenation/tex-hyphen
END OF TERMS AND CONDITIONS

---

Expand Down
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![npm version](https://img.shields.io/npm/v/three-text.svg)](https://www.npmjs.com/package/three-text)
[![TypeScript](https://img.shields.io/badge/built%20with-TypeScript-007acc.svg)](https://www.typescriptlang.org/)
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3_or_later-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

High fidelity 3D mesh font geometry and text layout engine for the web

Expand All @@ -19,7 +19,7 @@ High fidelity 3D mesh font geometry and text layout engine for the web

The library has a framework-agnostic core that returns raw vertex data, with lightweight adapters for [Three.js](https://threejs.org), [React Three Fiber](https://docs.pmnd.rs/react-three-fiber), [p5.js](https://p5js.org), [WebGL](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API), and [WebGPU](https://developer.mozilla.org/en-US/docs/Web/API/WebGPU_API)

Under the hood, three-text relies on [HarfBuzz](https://github.com/harfbuzz/harfbuzzjs) for text shaping, [Knuth-Plass](http://www.eprg.org/G53DOC/pdfs/knuth-plass-breaking.pdf) line breaking, [Liang](https://tug.org/docs/liang/liang-thesis.pdf) hyphenation, [libtess.js](https://github.com/brendankenny/libtess.js) (based on the [GLU tessellator](https://www.songho.ca/opengl/gl_tessellation.html) by Eric Veach) for removing overlaps and triangulation, curve polygonization from Maxim Shemanarev's [Anti-Grain Geometry](https://web.archive.org/web/20060128212843/http://www.antigrain.com/research/adaptive_bezier/index.html), and [Visvalingam-Whyatt](https://hull-repository.worktribe.com/preview/376364/000870493786962263.pdf) [line simplification](https://bost.ocks.org/mike/simplify/)
Under the hood, three-text relies on [harbuzzjs](https://github.com/harfbuzz/harfbuzzjs) (based on [HarfBuzz](https://github.com/harfbuzz/harfbuzz) by Behdad Esfabod et al) for text shaping, [Knuth-Plass](http://www.eprg.org/G53DOC/pdfs/knuth-plass-breaking.pdf) line breaking (with [SILE](https://github.com/sile-typesetter/sile/blob/master/core/break.lua) being the cleanest modern reference), [Liang](https://tug.org/docs/liang/liang-thesis.pdf) hyphenation and the [Tex hyphenaton patterns](https://github.com/hyphenation/tex-hyphen), [libtess.js](https://github.com/brendankenny/libtess.js) (based on the [GLU tessellator](https://www.songho.ca/opengl/gl_tessellation.html) by Eric Veach) for removing overlaps and triangulation, adaptive curve polygonization from Maxim Shemanarev's [Anti-Grain Geometry](https://web.archive.org/web/20060128212843/http://www.antigrain.com/research/adaptive_bezier/index.html), [Visvalingam-Whyatt](https://hull-repository.worktribe.com/preview/376364/000870493786962263.pdf) [line simplification](https://bost.ocks.org/mike/simplify/), and the [woff2-decode](https://github.com/countertype/woff2-decode) library for WOFF2 decoding

## Table of contents

Expand Down Expand Up @@ -79,11 +79,11 @@ Most users will just `import { Text } from 'three-text'` for Three.js projects

```javascript
import { Text } from 'three-text/three';
import { decode } from 'woff2-decode'; // Optional
import { decode } from 'woff2-decode';
import * as THREE from 'three';

Text.setHarfBuzzPath('/hb/hb.wasm');
Text.enableWoff2(decode); // Enabling WOFF2 support adds ~45kb to the bundle
Text.enableWoff2(decode); // Optional, adds ~45KB to bundle
const result = await Text.create({
text: 'Hello World',
font: '/fonts/Font.woff2',
Expand Down Expand Up @@ -172,7 +172,7 @@ cp node_modules/harfbuzzjs/hb.wasm public/hb/
Then, before any `Text.create()` calls, configure the path:

```javascript
import { Text } from 'three-text/three';
import { Text } from 'three-text';
Text.setHarfBuzzPath('/hb/hb.wasm');
```

Expand All @@ -184,7 +184,7 @@ This method is essential for applications that use Web Workers, as it is the onl


```javascript
import { Text } from 'three-text/three';
import { Text } from 'three-text';

// Main thread
const wasmResponse = await fetch('/hb/hb.wasm');
Expand All @@ -203,15 +203,15 @@ The library will prioritize the buffer if both a path and a buffer have been set

**NW.js with CommonJS:** If using `require()` to load the CJS build in NW.js, use Option 2 (buffer-based loading). NW.js's [dual-context architecture](https://docs.nwjs.io/For%20Users/Advanced/JavaScript%20Contexts%20in%20NW.js/#separate-context-mode) causes path resolution issues in this specific scenario. ESM imports and bundled code work normally

**Electron with `file://` protocol:** If loading HTML directly from the filesystem (not via a dev server), use Option 2 (buffer-based loading) or enable `nodeIntegration` in your BrowserWindow
**Electron with `file://` protocol:** If loading HTML directly from the filesystem (not via a dev server), use Option 2 (buffer-based loading) or enable `nodeIntegration` in your `BrowserWindow`

### Hyphenation patterns

**For ES Modules (recommended):** Import and register only the languages you need:

```javascript
import enUs from 'three-text/patterns/en-us';
import { Text } from 'three-text/three';
import { Text } from 'three-text';

Text.registerPattern('en-us', enUs);
```
Expand Down Expand Up @@ -310,6 +310,8 @@ Line badness is calculated based on how much glue must stretch or shrink from it

This uses a three-pass approach: first without hyphenation (pretolerance), then with hyphenation (tolerance), and finally with emergency stretch for difficult paragraphs that cannot be broken acceptably

For book typesetting, TeX uses delta nodes to efficiently handle long paragraphs that may span multiple pages with many possible break points. Since three-text isn't a page layout engine, we take a simpler approach and store cumulative widths directly on each break candidate

#### Hyphenation

Hyphenation uses patterns derived from the Tex hyphenation project, converted into optimized trie structures for efficient lookup. The library supports over 70 languages with patterns that follow Liang's algorithm for finding valid hyphenation points while avoiding false positives
Expand Down Expand Up @@ -1036,6 +1038,6 @@ The build generates multiple module formats for core and all adapters:

## License

`three-text` was written by Jeremy Tribby ([@jpt](https://github.com/jpt)) and is licensed under the GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later). See the [LICENSE](LICENSE) file for details
`three-text` was written by Jeremy Tribby ([@jpt](https://github.com/jpt)) and is licensed under the MIT License. See the [LICENSE](LICENSE) file for details

This software includes code from third-party libraries under compatible permissive licenses. For full license details, see the [LICENSE_THIRD_PARTY](LICENSE_THIRD_PARTY) file
14 changes: 0 additions & 14 deletions dist/patterns/cs.cjs

This file was deleted.

28 changes: 0 additions & 28 deletions dist/patterns/cs.d.ts

This file was deleted.

14 changes: 0 additions & 14 deletions dist/patterns/cs.js

This file was deleted.

14 changes: 0 additions & 14 deletions dist/patterns/cs.umd.js

This file was deleted.

Loading