Justif

Languages and libraries

javascript text layout library

SHOW HN2026

198points
40comments
#294of 4,366 in 2026
Top 7%of 2026 by points

How HN took it

LovedMost comments that take a side are positive

14 positive, 8 neutral or asking, 2 mixed, 1 critical, out of 25 comments about the project. Thread score +0.45.

Design: 7 for, 0 againstExecution: 1 for, 1 againstIdea: 2 for, 0 against

The thread, comment by comment

Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.

positive neutral or mixed critical about another commenter or something else the maker

What HN said

What people liked

  • Demo looks beautiful and impressive; typography much improved

    From 4 comments
    • 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…
      jstrieb on HN
    • Implemented on https://federalistreader.org ... made a big difference! You can see the comparison here: https://federalistreader.org/notes/justif/ Nicely done! (and thanks for…
      vhwalke on HN
    • 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…
      svat on HN
    • 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.
      antics9 on HN
  • Useful for print templates, blogs and historical typesetting

    From 4 comments
    • Good,this is very helpful for handling the layout in the print template.
      heroncoder on HN
    • Will be switching my blog to this.
      sebmellen on HN
    • Wow! I've spent the past few weeks setting 18th-century newspaper text on the web - justified, up to three narrow columns, period ligature, and the gap between CSS justification…
      vhwalke on HN
    • A most welcome addition to a webmaster’s toolkit. Congratulations!
      savoyard on HN

Objections

  • Quadratic-time algorithm may be slow on long paragraphs

    From 1 comment
  • Drop caps with floats overflow the gutter

    From 2 comments
    • Does this work with drop caps or could it be made to work with them? Cool work by the way.
      asimpletune on HN
    • Follow-up, since I asked the questions above: I spent the evening running Justif against the hardest page I have: three 356px columns of 18th-century text set in IM Fell at…
      vhwalke on HN

Requests

  • Support for irregular shaped edges and per-line widths

    From 1 comment
    • 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…
      torgoguys on HN
  • Exclusion selector for paragraphs like drop caps

    From 1 comment
    • Follow-up, since I asked the questions above: I spent the evening running Justif against the hardest page I have: three 356px columns of 18th-century text set in IM Fell at…
      vhwalke on HN
  • Thin or intersentence space distinction for abbreviations like No.

    From 1 comment
    • Great work. It looks as the space in "No. 12" is too large. Is it possible to distinguish between space and sentence-end-space?
      emil-lp on HN

Questions

  • Whether the maker used LLMs to write the code

    From 1 comment
    • 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…
      jstrieb on HN
  • How hyphenation and narrow column widths are handled

    From 1 comment
    • Wow! I've spent the past few weeks setting 18th-century newspaper text on the web - justified, up to three narrow columns, period ligature, and the gap between CSS justification…
      vhwalke on HN

Alternatives named

  • Chromium text-wrap: balance

    From 1 comment
    • 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]…
      wrs on HN
  • TeX microtype package

    From 1 comment
    • 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…
      lyall on HN

Category, keywords, summaries and labels on this page were made by AI (Thread Reader v2) and not checked by hand. Each point links to the comments it came from.

Add a badge to your READMEShown on HackerShow
[![Shown on HackerShow](https://hackershow.org/badge.svg)](https://hackershow.org/show/48946738)