HTML Text Justification and Hyphenation
Thursday Jan 08, 2009 Filed in: Ming Hsu
One thing easy to do
(but not easy to do well) in word processing software
is to use hyphenation when justifying text. Up until
now there have been really no way to do so on the
web. I recently heard that both IE6, Safari, and
recently Firefox 3, all began to support
soft hyphenation. Basically you put the
reference code—­—in the area where one
might want to insert a hyphen. Now I don't
understood why this should be something that is
done on the language side (i.e., html) rather than
browser side. I mean, you are not asked in either
Word or Latex to put some random marker of where
you might possibly hyphenate. Nevertheless,
I don't ask for much and this is better than
nothing, and the difference can be quite stark,
especially when working with narrow blocks of
text.
Here are some pictures
to show the with and without hyphenation. Here is the
before version of the block of text on the front page
prior to hyphenation. The white spaces were a huge
eyesore, and depending on the text size, browser, and
monitor resolution, where these hideous white spaces
showed up will differ. That is, one can never hard
code those stupid hyphens in.

It would be a pain of
course to enter these manually, but thanks to
a post from the Rapidweaver Forum, I
found this web tool that automatically hyphenates
your text. Someone might write a plugin for
Rapidweaver, but as I said earlier, this seems
like it should be a job for the rendering engine
rather than the language. Namely you get totally
unreadable code like the following.
The goal of our research group is to under­stand the
behav­ioral and neural basis of eco­nomic
decision-making. These are the inter­dis­ci­
pli­nary research areas of behav­ioral eco­nom­
ics and neu­roe­co­nom­ics. These
ques­tions allow us to bring a vari­ety of models and
meth­ods, includ­ing non-expected util­ity theory,
behav­ioral and psy­cho­log­i­cal
game theory, lab and field exper­i­ments, as well as
neu­roimag­ing, neu­ropsy­cho­log
­i­cal, and phys­i­o­log­i­cal
data.
The
results are quite stunning. Two well placed hyphens
and the unspeakably ugly (slight exaggeration) white
spaces is replaced with free flowing text. Still,
it's enough of an effort that I won't be doing this
except in text blocks that clearly have a spacing
problem.

