Re: [csswg-drafts] [css-text-4] Hyphenate only overflowing words? (#616)

I found this while I'm looking for a good penalty value for hyphenation points in a `text-wrap: pretty` prototype. In score/penalty-based paragraph-level line breaking algorithms such as TeX, authors can ajust the penalty for hyphenation points by `\hyphenpenalty`. Then the algorithm computes the score from multiple penalty values and choses the break points of the best score. Setting the hyphenation penalty to a lot high value, but still lower than the overflow, can fulfill the request.

How about exposing the hyphenation penalty in some abstracted forms? Such as:
```css
hyphens-penalty: auto | low | medium | high | overflow;
```
Then authors can control the frequency of automatic hyphenation, not just a switch of on/off/emergency, for smarter algorithms as @litherum described in #672.


-- 
GitHub Notification of comment by kojiishi
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/616#issuecomment-1543866532 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 11 May 2023 11:59:16 UTC