Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[articles/typography/linebreak] Existence of higher-quality line breaking algorithms #166

Closed
jfkthame opened this issue Jul 28, 2018 · 4 comments

Comments

@jfkthame
Copy link

[source] (http://w3c.github.io/i18n-drafts/articles/typography/linebreak.en) [en]

The description of "space delimited words" describes only the simplest of algorithms:

When the end of the line is reached, the application typically looks for the previous space, which is taken to be a word delimiter, and wraps everything after that to the next line.

While it's true that this simple approach is commonly used, it might be worth mentioning that there are more sophisticated options that may be appropriate in applications where typographic quality is valued. E.g. it may be possible to reduce the inter-word spacing on a line, in order to allow a word to fit when it would naturally overflow slightly; or conversely, it may be better to choose an earlier break than the immediately-preceding space, moving a word down even though it could fit, in order to improve a following line.

@shreevatsa
Copy link

+1, like the TeX algorithm which tries to find something globally optimal over the entire paragraph. (Great read: Knuth and Plass, Breaking Paragraphs Into Lines.)

r12a added a commit that referenced this issue Jul 31, 2018
@r12a
Copy link
Contributor

r12a commented Jul 31, 2018

@jfkthame this article is about line-breaking, and there's already another article about justification, however, i think it is worth mentioning what you say, so i added a note, and since you expressed it well, so i largely used your words. Thanks.

@shreevatsa yes i'm aware of what you mention, thanks, but think it's better covered in the article on justification than here.

Closing now. Reopen if more on this topic.

@r12a r12a closed this as completed Jul 31, 2018
@jfkthame
Copy link
Author

@r12a Thanks. Yes, I saw there's also an article about justification; but skimming that article, it seemed to focus on the justification of individual lines and didn't mention (AFAIR) the potential interaction between justification and line-breaking. So I thought it worth adding a comment somewhere.

@r12a
Copy link
Contributor

r12a commented Jul 31, 2018

@jfkthame yes, i too noticed, with surprise, that i hadn't mentioned more complex approaches to justification in the other article, and made a note to myself to add something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants