semantic-wrap
Choose line breaks using both a language model's semantic boundaries and browser measurements.
What does it do?
The library first uses a language model to identify natural break candidates within a sentence. It then measures the actual layout in the browser using the current font and container width. It applies a result to the page only when the candidate has a low semantic cost and its line balance is within an acceptable range. The page says users can compare the result directly with CSS balance.
Key features
- Predict natural line break candidates with a language model
- Measure the current font and container width in the browser
- Apply results after evaluating semantic cost and line balance
- Compare results with CSS balance