News for hackers. Stuff that matters.
Re:Text Rendering Hates You by chrismorgan on Monday June 26, 2023 @09:12AM (#36479268)
Soft hyphens are no use in this case, because browsers take them as a break opportunity of equal standing with a space. In my experience, liberal sprinkling on soft hyphens makes things worse, not better, because you end up with loads of gratuitous hyphens. What’s needed is a different algorithm for breaking paragraphs into lines, something better than the greedy algorithm that all browsers use. Something like Knuth-Plass, which applies a penalty to hyphens so that it’ll use them if the alternatives are bad enough, but won’t be too eager about using them.
Re:Text Rendering Hates You by DonHopkins on Monday June 26, 2023 @09:50AM (#36479648)
Supple hyphens, then?
Re:Text Rendering Hates You by sings on Monday June 26, 2023 @09:51AM (#36479653)
I definitely agree that soft hyphens are a simplistic workaround if used in the way I suggested, and are indeed inferior to a complex and well-thought out hyphenation system. Still, if someone is considering `word-wrap: break-word;` for narrow table columns, soft hyphens are worth knowing about.
Re:Text Rendering Hates You by hinkley on Monday June 26, 2023 @02:51PM (#36484072)
I have learned this, forgotten it, and then stepped on this garden rake again a handful of times in my career.

HTML should treat hyphens as hints and nobody does.