[whatwg] Hyphenation

Kornel Lesinski kornel at osiolki.net
Tue Jan 9 15:16:31 PST 2007


On Tue, 09 Jan 2007 13:03:04 -0000, Leons Petrazickis  
<leons.petrazickis at gmail.com> wrote:

> I would suggest that the first priority is getting a naive hyphenator
> into browsers. Since you only ever need hyphenation when
> full-justifying

I disagree. It's also needed in narrow columns, even if they're  
left-justified and may be useful for very long words in general.

> Once that is in place, we can start thinking about special cases. I
> would suggest a hyphenation dictionary in the <head> of the document.

Hyphenation dictionary supplied by the page seems like a good idea, but  
having it in <head> might cause some headaches in dynamic systems:
* in some template systems adding anything to <head> is difficult
* author may want to compose page from several independent fragments,  
possibly each having its own dictionary. Merging these dictionaries would  
either require some extra logic or cause duplicate entires (and authors  
won't like that waste).
* One would have to keep in sync dictionaries and text (in practice there  
will be cases when dictionary lacks some words or contains words which  
aren't present in text any more)
* syntax proposed is verbose and with entire dictionary repeated on every  
page that adds up to a substantial traffic

And this problem can't be solved by using external file for dictionary, as  
it will either delay initial display of the page until dictionary is  
loaded or will require reflow of entire page.


Therefore I suggest something possibly a bit more difficult to UAs - learn  
 from the text in document.

Having document with:
The zoë-ven hypertext must ab-stain from grooming monkeys in an
indefatigably questionable fashion. The zoëven hypertext must abstain
 from grooming monkeys in an indefatigably questionable fashion.

UA would make note of words with soft hyphens and replace further  
non-hyphenated occurances with hyphenated ones:
The zoë-ven hypertext must ab-stain from grooming monkeys in an
indefatigably questionable fashion. The zoë-ven hypertext must ab-stain
 from grooming monkeys in an indefatigably questionable fashion.

(decision whether this is visible in DOM or not is probably best left to  
implementation).

As for the exceptions in hyphenation, I'm in favor of <hyph> element.


-- 
pozdrawiam, Kornel Lesiński



More information about the whatwg mailing list