Live data from Hacker News

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

justif.lyall.co

11–20 of 43 posts

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

#11
post #6

For OP: I think "Type specimen" should be the default sample text, just to get readers into the right spirit. :) For anyone else reading this: make sure you click on the "controls & metrics" at the bottom to try out all the options (such as comparing with your browser's "text-wrap: pretty"); it's really cool!

It is the default if you open the demo on a narrow screen! It has a more striking difference between browser and justif layouts at narrow widths than the Alice sample. But maybe you’re right and it should be the default for everyone.

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

#12
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)?

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

#13

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)?

That's not something justif supports directly right now. It currently targets rectangular blocks, not arbitrary edge shapes. But the underlying line-breaking approach could accommodate per-line widths, so it would be plausible to add I think.

Feel free to make a GitHub issue with details and I can take a look at supporting it. For now the workaround would be falling back to native justification by excluding the paragraph from justif, and using css float/shape-outside to get the desired edge.

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

#14
post #4

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...

[flagged]

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

#15
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!

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

#18
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.

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

#20

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)?

The fact TeX can do stuff like this is crazy when you think about it. Especially because it was all a yak shave while Knuth was writing TAOCP.
Post reply on HN