
Using hyphenation and justification on the web - duck
http://www.alistapart.com/articles/the-look-that-says-book/
======
scott_s
This is the sort of thing that belongs in the browser itself, not specified in
the HTML for each page. We should be able to write text in HTML as ASCII, and
if the HTML says "justify this text," the browser should know the hyphenation
points for all of the words. It should be the responsibility of the rendering
engine, not the content.

~~~
binomial
TeX justification really needs to be ported to browsers. Are those hyphenation
algorithms really that hard to implement?

~~~
celoyd
_Are those hyphenation algorithms really that hard to implement?_

Yes: see (for example) <http://en.wikipedia.org/wiki/Hz-program> .

A really good H&J algorithm is doing a significant amount of work. It has to
think about things like successive hyphens (which get distracting quickly),
rivers (the unpleasant vertical lines of whitespace that appear especially in
over-spaced text), and so on. This involves lots of backtracking and image
processing, and it fires every time the layout changes. It’s all possible to
do in a browser someday, but it’s not trivial.

------
ancymon
There are also opinions that text justifying is a "crime".

Some ([http://line25.com/articles/10-usability-crimes-you-really-
sh...](http://line25.com/articles/10-usability-crimes-you-really-shouldnt-
commit)) say that justified text is hard to read for Dyslexic users.

Others ([http://www.v7n.com/forums/web-usability/42975-justify-not-
ju...](http://www.v7n.com/forums/web-usability/42975-justify-not-justify-
question.html#post511927)) claim that ragged right side can help "keeping
place" in the text. (but why then the books are justified?)

Anyway because of that and because it is troublesome to implement
justification correctly I think adding those soft-hyphens isn't worth a
trouble.

~~~
ugh
It’s not so bad if you use hyphenation appropriately. Which, as the submission
explains, is sort of doable on the web but has serious downsides.

What you would really want is a fancy justification algorithm like the one
InDesign uses (it takes into account not just the current line but the whole
paragraph and it avoids, among other things, white rivers in the text) with
lots of knobs to turn.

That’s currently just not possible on the web which is why justification is
often not such a good idea even if you can find workarounds. But it’s
certainly no crime. (All books, newspapers and magazines do it.)

------
Semiapies
I'm not crazy about hyphenated, justified text in the first place. It may look
pretty, but I get briefly jolted out of the flow of the text at every
truncated word.

Maybe it's a relic of printing processes that can be left behind.

~~~
dkarl
A good typesetting program like TeX minimizes the occurrence of broken words.
The sample page the article linked to
(<http://readableweb.com/ala/booklook/lanhamvolatilehard.htm>) looks pretty
awful to me, way too many hyphens. You don't see that many broken words in
professionally typeset text.

~~~
zzo38
TeX is a very good typesetting program.

------
shawndumas
"TypeSet[1] is an implementation of the Knuth and Plass line breaking
algorithm using JavaScript and the HTML5 canvas element. The goal of this
implementation is to optimally set justified text in the new HTML5 canvas
element, and ultimately provide a library for various line breaking algorithms
in JavaScript."

[1]: <http://www.bramstein.com/projects/typeset/>

------
grk
I think the deal breaker here is that search only works on FF.

------
jipumarino
I seem to remember that justification makes it harder to read much in the way
all caps do. Ragged edges supposedly helps you stay in the right line when
reading. Does anyone have any info on this?

~~~
jerf
It is a "well-known fact" on the internet, based on my searching, but I
couldn't find a definitive source on the matter, even though I'd swear I've
seen one. (Perhaps I too am simply remembering the "well-known fact".) I even
found several people asking for the definitive source and coming up empty.

The best justification (no pun intended) for using "ragged text" I found was
under the heading "Text Alignment" on
[http://community.infragistics.com/ux/articles/text-
treatment...](http://community.infragistics.com/ux/articles/text-treatment-
and-user-experience.aspx) .

It is also my opinion that full justification may make the text block as a
whole prettier but makes the text significantly harder to read. However, soft
hypens and zero-width spaces still have a role to play on the web even so
because justified and ragged-right text both have problems with very, very
long words, and on the internet multi-hundred character words actually show up
with some frequency, mostly as URLs.

~~~
stan_rogers
I've heard the "line identification hypothesis" mentioned a few times in
regards to preferring ragged-right, but I'm pretty sure that's just a guess.
It seems readers do find fully-justified text harder to read on the web
sometimes, but I'd be willing to bet that it has a lot more to do with column
width, leading and word/letter spacing. (Without appropriate hyphenation, word
spacing can vary greatly in justified text, especially when lines are short-
ish and words are long-ish.) I've found that a good screen-purposed serif
typeface set with extra leading (1.2 em seems to be about right) and a line
length of 35-40 ems works very well as justified text for "publications".
Decent automated hyphenation ought to make things a lot better.

