Justif: 网页排版级文本对齐与微排版工具

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

Justif 是一款专为网页打造的出版级文本对齐解决方案,它引入了 Knuth-Plass 算法和微排版技术,彻底告别传统网页排版中参差不齐的空白和难看的断行。无论是长篇文章还是精致的设计作品,Justif 都能让文字像印刷品一样优雅流畅,显著提升阅读体验。开发者无需复杂配置,即可在网页中实现媲美专业出版物的排版效果,让每一行文字都充满美感。

Justif 将出版级的文本对齐与微排版技术带入网页,让文字排版从此告别粗糙,焕发印刷品般的精致美感。
  1. jstrieb

    Wow, I'm seriously impressed! Questions for the author:

    I haven't had a chance to read the code yet, but how does this actually adjust the text? I get that it uses Knuth-Plass to calculate layout, but what does it do in CSS (or SVG?) to apply the layout to the DOM?

    Looks like the first commit was sometime last week, which is pretty tight turnaround for something like this. For my own sanity when reading the code (no judgment either way), did you use LLMs to help write this? Knowing is helpful for me to calibrate what I pay attention to when reading through the code.

  2. Rendello

    I remember when I was learning CSS back in 2012, the guides said to never center-justify text as browsers did a terrible job. Since then, CSS has become way nicer, and yet justified text still looks awful. Great (or even good) typography always feels impossible on the web.

    But this demo blew me away! Fantastic!

  3. taevirus

    Good

  4. torgoguys

    I haven't looked at the API yet, but the demo is great on my phone. Instead of just justified blocks, can you have it do a "justified" (even amount of spacing) from an irregularly shaped right edge (in my case, an image on the right side of a design template I made)?

  5. svat

    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!

同日更多故事

2026-07-21