Justif: Knuth-Plass justification and microtypography for the web

61 points by lyall


swannodette

This is vibecoded with Fable https://news.ycombinator.com/item?id=48946738#49002419

vbernat

The result looks really nice. You go even further than TeX (unless you use the microtype package). Such typesetting should be done directly by the browser. Some browsers implements text-wrap: pretty but it's limited to a few lines (6?).

chrismorgan

I have long felt that hanging punctuation is overdone. If you notice it, it’s too much: and it’s almost always noticeable on in particular, where it should hang less than half as much. Actually, I like the fact that a start-of-paragraph essentially serves as a little text-indent.

The subtler effect of “protrusion” turned on but “hang punctuation” off feels tolerable (though I’d still prefer it off in most cases).

Too much of these sorts of things depends on the specific font. In my chosen serif (Equity), an “f,” at end of line looks wrong with this adjustment, because kerning has already tucked the comma under the f, so now the top of the f is protruding out of the line. Related, I wonder what it’d be like if serif fonts put the tail/spur beyond the character advance so that it would hang; that feels a more worthy thing to hang than most punctuation.

On tracking: letter-spacing is risky because it interacts poorly with ligation. Either ligation happens first and you end up with “T h i s   i s   fi n e!”, or non-zero letter-spacing disables ligation and you get the f colliding with the dot of the i. (You’ll generally get the latter, but it depends a little on script and font and explicitly-enabled OpenType features, which can easily be done accidentally.)