Live data from Hacker News

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

justif.lyall.co

41–43 of 43 posts

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

#42
post #29
post #28

Great work. It looks as the space in "No. 12" is too large. Is it possible to distinguish between space and sentence-end-space?

Good eye! The space in "No. 12" would traditionally get a thin space [0] in professionally typeset documents, which is smaller than the standard space used for inter-word and inter-sentence spacing. 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". 0: https://en.wikipedia.org/wi…

Not quite. A "thin space" is thinner than an ordinary interword space, which in turn is thinner (or at least less stretchy) than an intersentence space. The space in "No. 12" or "Fig. 7" or "Mr. Jones" or "cf. page 5" is by definition an interword space! The problem is that HTML renderers tend to prefer to set it as an intersentence space instead, because they think "." always indicates the end of a sentence. Using   can help; that's like "~" in TeX. TeX also supports a breaking-but-never-intersentence-sized space via "\ " (backslash space), which is what you'd probably want to use in "cf.\ page~5." AFAIK, HTML/Unicode have no equivalent of that.

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

#43
Very cool. This is near and dear to my heart. I've been doing something similar in my apps, but I took a different approach using WASM to measure fonts. I'll admin, I used agents to implement, but I'm happy with the solution. I'll compare more today, but I'd love your thoughts on what limitations you've run into with your approach, and if you're interested, to compare notes. https://github.com/currentspace/knuth-plass-wrap
Post reply on HN