https://github.com/pouyakary/monojustifier
A justification algorithm specifically designed for monospace environments like terminal emulators and text editors.
https://github.com/pouyakary/monojustifier
ascii-art justification monospace monospaced terminal text-justification text-justify
Last synced: 2 months ago
JSON representation
A justification algorithm specifically designed for monospace environments like terminal emulators and text editors.
- Host: GitHub
- URL: https://github.com/pouyakary/monojustifier
- Owner: pouyakary
- Created: 2024-01-14T23:32:07.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-26T09:43:42.000Z (about 1 year ago)
- Last Synced: 2025-02-02T10:21:31.550Z (4 months ago)
- Topics: ascii-art, justification, monospace, monospaced, terminal, text-justification, text-justify
- Language: TypeScript
- Homepage:
- Size: 23.4 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# MonoJustifier
There are many justification algorithms and engines out there, but this one is specifically for the mono width environment like terminal emulators and text editors. One use of this is for a comment justification extension on vscode or in the TextGraphic framework.
I have made this algorithm after years of needing something specifically for monospace environments that is tailored with care to make text look nice there. No algorithm is designed for this purpose and those that do are so basic. I have created a new system that is fast, and very powerful, supporting many important features that were previously non-existent:
- Last Line Orphan Word Handler
- Specialized Mono Width Typographical River Elimination
- Specialized Mono Width Space Balancer
- Word Breaker for Long Words With Controllable Tolerance Factor```ts
import { MonoJustifier } from '@kary/justifier';
const justifier = new MonoJustifier(40);const justifiedLines = justifier.justify([
'Mono Justifier is a text justification engine specially',
'designed for the mono space environments like terminal',
'and text editors.'
]);
```