Show HN: Justif – Knuth-Plass justification and microtypography for the web
31–40 of 43 posts
Re: Show HN: Justif – Knuth-Plass justification and microtypography for the web
#32Re: Show HN: Justif – Knuth-Plass justification and microtypography for the web
#33
Users of something like this should ALWAYS use subresource integrity, and the example script tag should, too.Re: Show HN: Justif – Knuth-Plass justification and microtypography for the web
#34Great work. It looks as the space in "No. 12" is too large. Is it possible to distinguish between space and sentence-end-space?
The "standard" method would be to double space after the end of a sentence. This is how "filling" paragraphs works in org-mode to avoid breaking a line in the middle of an abbreviation.
The actual approach used by a printer would be to be more generous with spacing material at the end of a sentence.
The relevant TeX commands are \frenchspacing or \nofrenchspacing.
Re: Show HN: Justif – Knuth-Plass justification and microtypography for the web
#35Re: Show HN: Justif – Knuth-Plass justification and microtypography for the web
#36Does this work with drop caps or could it be made to work with them? Cool work by the way.
Re: Show HN: Justif – Knuth-Plass justification and microtypography for the web
#37Wow, 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…
The layout is done entirely in DOM. The layout engine calculates the line breaks, tracking, expansion, etc. then applies the layout using HTML spans with the appropriate attributes applied. There’s generally one span per line, but that can change for more complicated lines! I invite you to inspect the demo page in your browser’s dev console if you’re particularly curious. And yes, I did use LLMs for the implementatio…
> 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.
This philosophy has been growing on me - a coworker framed it as “nuance melts away with LLMs”
I recently wanted to render a 100+ page document in an interactive WYSIWYG editor using a single stroke font and join the letters to form single stroke cursive words that appeared handwritten.
The permutations of rulesets that governed connections between letters (I.e. how does t connect to c, and do you need to lift the pen to make that connection) amplified by the randomness injected into the strokes and line width/angle (handwriting doesn’t have uniform letters or lines!) would have been intractable previously.
But, with an agent harness, I could do 3 or 4 examples of what “right” looked like - give it the ability to generate and screenshot test cases to see the output of its work - and it could grind through a reasonable ruleset for about $20 in spend.
Re: Show HN: Justif – Knuth-Plass justification and microtypography for the web
#38As a little public resource announcement: Users of something like this should ALWAYS use subresource integrity, and the example script tag should, too.
Re: Show HN: Justif – Knuth-Plass justification and microtypography for the web
#39Sure, it takes a bit longer, but LaTeX pretty much instantly produces a PDF nowadays even for long documents. 30 years ago, I scheduled a coffee break for that.