frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Show HN: Justif – Knuth-Plass justification and microtypography for the web

https://justif.lyall.co/
23•lyall•4d ago
Justif is a drop-in JavaScript library that progressively enhances web pages to TeX-level text justification. Installation is a single <script> line, standard text and accessibility affordances are unchanged, and users with JS disabled get native browser rendering.

I made justif because I've long been a fan of justified text. I think it looks clean and elegant, and makes reading more enjoyable. But bad justification is the opposite, with gaping spaces that distract me to the point of making the text near unreadable.

Browsers have got better recently at handling justified text [0][1], but still use suboptimal greedy algorithms for the most part, and are not near that TeX/InDesign level of quality that I crave. `text-wrap: pretty` exists but is far from a panacea, as you can see for yourself in the demo.

Justif also has the benefit of providing more consistent text layout across browsers. Blink (Chrome), Gecko (Firefox) and WebKit (Safari) all justify text differently, so normally what the user sees depends on what browser they use.

Take a look at the demo, play around with it, see if you can break anything. I'm open to improvements of the API design as well, so please let me know your thoughts.

For more details, see the README: https://github.com/lyallcooper/justif

0: https://cloudfour.com/thinks/justified-text-better-than-expe...

1: https://owickstrom.github.io/the-proportional-web/

Comments

svat•4d ago
This is great! Loved the demo and controls (and nice touch to include The Frog Prince as one of the sample texts lol). I think by doing tracking and expansion you're going even further than original Knuth TeX did/does. Maybe for the demo when hyphenation is turned off, the browser side should also turn it off? Or leave it like this, justif without hyphenation still does better than browser with hyphenation :)

Wish this project great success!

lyall•4d ago
Thank you! And yes by default TeX doesn't do tracking or expansion, but the microtype [0] package does.

And I did struggle a bit with deciding how best to do the comparison to native browser rendering. I wanted it to be an apples-to-apples comparison, but also didn't want to unfairly handicap the browser by disabling something like hyphenation. It's already bad enough as is...

0: https://ctan.org/pkg/microtype

wrs•49m ago
Chromium supposedly implemented Knuth-Plass for CSS's "text-wrap: balance", but reading the end of the tracking bug [0] it seems it stops at six lines? (Design doc: [1])

[0] https://issues.chromium.org/issues/40270471 [1] https://docs.google.com/document/d/1jJFD8nAUuiUX6ArFZQqQo8yT...

antics9•46m ago
Side-by-side didn’t do it for me but flicker made all the difference!

This is great, wish that browsers would implement a better algorithm.

Also good execution with the demo page.

Show HN: A self-running space economy SIM in Rust and Bevy

https://github.com/Kalcode/spaceprojectsim
59•kalcode•3h ago•20 comments

Show HN: Justif – Knuth-Plass justification and microtypography for the web

https://justif.lyall.co/
23•lyall•4d ago•4 comments

Show HN: Read the Tape – Wordle for daytrading, five blind S&P 500 charts a day

https://readthetape.cc/
14•will_asouka•1d ago•12 comments

Show HN: CodeAlmanac – Karpathy-style codebase wiki from your conversations

https://github.com/AlmanacCode/codealmanac/
34•divitsheth•4h ago•12 comments

Show HN: Imagin Raw – A 9MB Open-Source Alternative to Adobe Bridge for Mac

https://github.com/cristibaluta/Imagin-Raw
49•cristi_baluta•4h ago•19 comments

Show HN: Orate – On-device neural text-to-speech queue for Mac

https://orate.to/
6•bherms•1h ago•0 comments

Show HN: Anypost – transactional and broadcast email API, 8¢ per 1k

https://anypost.com
7•dancablam•7h ago•0 comments

Show HN: Word in Web – Near MS Word Parity Docx Editor in Web

https://word-in-web.com/
14•theRealestAEP•4h ago•2 comments

Show HN: Meltbox – where your agents send you briefs

https://meltbox.ai/
2•flysonic10•54m ago•0 comments

Show HN: Language Model Builder (an app to learn about and build models)

https://languagemodelbuilder.com/
11•felixrieseberg•4h ago•2 comments

Show HN: Chalk: a Mac app for technical diagrams with a built-in MCP for Claude

https://chalk.appkit.studio
3•davideweaver•1h ago•0 comments

Show HN: OSS Cross-Harness self hosted registry and analytics for AI Agents

https://github.com/Observal/Observal
18•haz3-jolt•4h ago•1 comments

Show HN: Explore 6048 YC companies as an interactive galaxy

https://artifacta.io/a/pg_x9pombpdybx90q2s16eu
34•jnakano89•2d ago•18 comments

Show HN: SciStudio: organize chaos data analysis pipelines with workflow runtime

https://scistudio.io/
2•jiazhenz•1h ago•1 comments

Show HN: Designing a Static Site Generator for iPhone

https://hypertemplates.net/blog/designing-an-ssg-for-iphone/
7•calebhailey•3h ago•0 comments

Show HN: Datalevin – a simple, fast, and versatile Datalog database

https://github.com/datalevin/datalevin
3•huahaiy•1h ago•0 comments

Show HN: DocCharm – The help center that keeps itself up to date

https://doccharm.com/
6•yakshaving_jgt•4h ago•2 comments

Show HN: In Meeting – A native macOS Mic/Cam observer for home automation

https://github.com/fellowgeek/in-meeting
6•pcbmaker20•4h ago•0 comments

Show HN: TokenPath – token-level citations for LLM output, read from attention

https://tokenpath.ai
4•apoorvumang•2h ago•0 comments

Show HN: Edky, a CLI to convert Ed25519 public keys from one encoding to another

https://github.com/artob/edky
6•arto•3h ago•3 comments

Show HN: Observability for Coding Agents and LLM Applications

https://telemetry.dev/
2•ephraimduncan•2h ago•0 comments

Show HN: Posecode, a text language and renderer for human movement

https://www.posecode.org/play
5•brnbrn•2h ago•0 comments

Show HN: X Downloader – save public X videos, MP3s and screenshots

https://xdownloader.site/
2•cser700•2h ago•1 comments

Show HN: Browser-based 3D terrain reconstruction

https://github.com/topherchris420/lop-nur-twin
4•ciao_chris•2h ago•0 comments

Show HN: NoopJS – A compiler that ships 0 KB JavaScript for static pages

https://github.com/noop-js/noopjs
2•pullrun•2h ago•0 comments

Show HN: How to fix blank pages in a PDF file

https://www.3emalak.com/p/convert-articles-to-epub-pdf-word-build.html
2•omeraliamm•2h ago•0 comments

Show HN: PMG, open source package firewall

https://github.com/safedep/pmg
3•abhisek•4h ago•1 comments

Show HN: Gift Ideas Tool on Wallble

https://www.wallble.com/gift-ideas
2•zainalabdin878•3h ago•0 comments

Show HN: Tsaagan – Browser control for AI agents that verifies every action

https://github.com/michaelolmos/tsaagan
2•molmos•3h ago•0 comments

Show HN: Fractal – recursive agent loops for complex, multi-step work

https://github.com/plasma-ai/fractal
14•ryanpettry•3h ago•1 comments