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.
Show HN: Justif – Knuth-Plass justification and microtypography for the web
21–30 of 43 posts
Re: Show HN: Justif – Knuth-Plass justification and microtypography for the web
#22Wow, 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…
And yes, I did use LLMs for the implementation, both Fable 5 and 5.6 Sol specifically. I would not have been able to achieve anywhere close to the current result unaided. My patience and expertise would’ve been exhausted long before getting anywhere especially interesting.
My philosophy with LLMs is to try to use them to achieve levels of quality and polish that would’ve been previously unreasonable. I hope this project is a demonstration of that.
Re: Show HN: Justif – Knuth-Plass justification and microtypography for the web
#23Beware: the TeX justification algorithm is quadratic-time.
I added the “Alice in Wonderland (long)” text sample to the demo as a stress test, but its paragraphs are still relatively short. I should add a sample that’s one really long paragraph and see what happens. I may need to add a bail-out after X items option if it calls for it.
Re: Show HN: Justif – Knuth-Plass justification and microtypography for the web
#24Earlier quoted context omitted.
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.
How narrow? On my phone it defaulted to Alice.
Re: Show HN: Justif – Knuth-Plass justification and microtypography for the web
#25Re: Show HN: Justif – Knuth-Plass justification and microtypography for the web
#26Re: Show HN: Justif – Knuth-Plass justification and microtypography for the web
#27Follow-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 ~17.6px with 24.3px leading. I came in curious and left planning the integration. The numbers were better than I hoped. A full ~5k-word essay justified in about 280ms, and ~36KB gzipped including the en-US patterns. And the output is the part that…
Re: Show HN: Justif – Knuth-Plass justification and microtypography for the web
#28Re: Show HN: Justif – Knuth-Plass justification and microtypography for the web
#29Great work. It looks as the space in "No. 12" is too large. Is it possible to distinguish between space and sentence-end-space?
The solution here is to fix the sample text itself to use U+202F (NARROW NO-BREAK SPACE,  ). As opposed to the standard width no-break space it currently has for "No. 12" and "Fig. 7".
Re: Show HN: Justif – Knuth-Plass justification and microtypography for the web
#30Great work. It looks as the space in "No. 12" is too large. Is it possible to distinguish between space and sentence-end-space?