Justifying text-wrap: pretty

47 points by vulcan 20 hours ago on lobsters | 11 comments

Nothing against the article, but opening it up and seeing that abomination of a link (in LibreWolf) made me chuckle.

Safari for comparison below: https://stuff.art-core.org/2026/pretty.png

And yeah, for all the "I like this font" I have said in the past, I guess in the end I can't say I care enough about typography. Would be cool, but I've lost any hope and as long as it doesn't look completely horrible to me, I'm fine. (But I might play around with these justify settings on my blog).

dijit | 12 hours ago

I've long had the opinion that websites are principally for conveying content. (though people are using them as application delivery mechanisms today).

If you care a lot about presentation, I can't think of anything better than PDF.

However, now that I reflect on this point, I am quite sad.

diktomat | 11 hours ago

If you care a lot about presentation, I can't think of anything better than PDF.

If your display is big enough. On small displays, like phones or ebook readers, it sucks.

singpolyma | 8 hours ago

Well that's by design. You can't both preserve the designers layout and adapt to different screen sizes

benoliver999 | 9 hours ago

There are features iirc to make responsive PDFs, but at that point you might as well use a web browser...

jaffray | 6 hours ago

The original paper on Knuth-Plass is a really wonderful read. I read it last year and worked through an implementation myself and it quickly became one of my favourite algorithms and favourite papers. It has the classic Knuth playfulness: https://gwern.net/doc/design/typography/tex/1981-knuth.pdf

bezdomni | 9 hours ago

My brain dislikes justified paragraphs. Can't put my finger on why. I just find them less pleasant to read. Even if the word spacing is mostly uniform.

gcupc | 6 hours ago

Do you dislike them only on the web, or in print, too? It might be worth looking at some books published between about 1880 and 1950 to see what justified paragraphs are really supposed to look like, if you haven't already.

pekkavaa | 3 hours ago

I believe the ragged-right whitespace pattern offers visual landmarks that make it easier to keep track of the line you're reading. No such cues in justified paragraphs.

dmbaturin | 9 hours ago

That's exciting. I still remember how I had a conditional in most of my websites to use hyphens: auto and text-align: justify in Safari and Firefox but resort to left align in Chrome...

BryceWray | 3 hours ago

I’ve played with styling such as the following, although never yet used it in production (this is mainly for serif only, definitely not recommended for sans-serif):

article p {
  @media only screen and (width >= 1024px) {
    @supports (text-justify: inter-character) {
      text-align: justify;
      text-justify: inter-character;
      hyphens: auto;
    }
  }
}

Seems to work OK in Chrome- and Firefox-based browsers in windows of at or above 1,024 pixels in width, while the @supports part keeps it from bothering Safari et al. for now.