Hacker News new | past | comments | ask | show | jobs | submit login

Because a) first fit, best fit or something else is trivial to implement, having a good total fit implementation that works in a lot of circumstances is not trivial (I have re-implemented a simpler version of the algorithm in Ruby including using a hyphenation library). b) you can ask the same question: why does almost no word processor implement this algorithm? And with word processors it is much more important! The answer is simple: Most word processors are doing many things badly so having a total-fit h&j (hyphenation and justification) algorithm would only make the output slightly better but still much inferior to good book typography.



why does almost no word processor implement this algorithm?

In TeX the line breaking depends on the whole paragraph. I imagine it could be visually quite distracting if the line-wrapping jumped around in a WYSIWYG word processor as you added text to a paragraph.

Edit: ah. I see this is noted in the posted article’s To-do section:

Figure out how to deal with dynamic paragraphs (i.e. paragraphs being edited) as their ratios will change during editing and thus visibly move around.


Try editing paragraphs in InDesign. In practice, it’s really not much of an issue, because paragraphs don’t actually jump around all that much, and to the extent that they do, it’s really not particularly distracting.


I tried it in Photoshop which since CS2 (or so) has an implementation of the Knuth & Plass algorithm. I found it quite distracting myself. Granted, I was on the lookout for text jumping around and had hyphenation disabled.


What about a menu (ribbon) item called "apply very nice typography to your document" which recalculates/reformats the paragraphs? Would this be a solution?


This is exactly why I prefer authoring documents in LaTeX vs WYSIWYG tools: I can concentrate on semantics and not worry about representation. Writing stuff in Word forces you to be distracted by its appearance on the page and can drive me crazy with micro-adjustments. With LaTeX, I just write the document and the computer does what computers are good at doing.


> I just write the document and the computer does what computers are good at doing.

Which is: Interpret your instructions very literally, so you still need to go over your document carefully to fix problems like urls running off the edge of the page?

Smart-arse joke aside, I agree with you that LaTeX is generally great, but it's not perfect, and sometimes it is difficult to make it do what you want.


Maybe. But there are probably all sorts of annoying details to deal with. For example, the pagination of the document could change, and so that would lead to further editing to fix it. Then how does line-breaking work during that editing phase, or in general after applying the menu item?

I don’t actually use a WYSIWYG editor any more, so I’ll leave my speculation there.


> why does almost no word processor implement this algorithm?

Because word processor implementors are lazy and incompetent? ;-)


Yes, I think that is the reason. Or perhaps: the users don't raise their voices to have something better?


> Or perhaps: the users don't raise their voices to have something better?

I think that probably most people don't realize there is something better, and can't even really tell the difference between typical word processor output and nice TeX-style optimal line breaks. It seems to me most people don't care that much about typography.


Alas, typography is one of those fields where most people only ever notice when you get it wrong.

A document presented with good typography might be easier to read for lengthy periods without losing concentration. There might be fewer distractions, like rivers of space running through the text, hard-to-read shapes due to poor kerning, or chunky CAPITALS and long numbers where small caps and old-style figures would not have disrupted the flow. There might be subtle visual cues to help the reader understand the material more quickly, like moving captions and headings closer to the subject material or spacing out bullet lists a little so their items are clearly separated.

But in a world where most people using word processors don't know what a stylesheet is and emphasis tends to consist of centring text, setting it in bold, capitals, and double-underlined, and then hitting enter a few times either side to space it out a bit, I think we can safely assume that most people either don't know about the subtleties of good typography or just don't care. The world might be a slightly better place if leading word processors all adopted better typographical conventions by default, and a few of us would appreciate the ability to produce better quality results, but I'm afraid it's never going to be a selling point for most people.


Word processors may be a lost cause, but we're in the middle of an e-book war (apparently), surely someone is going to display standard epub books better than anyone else and steal that all important typography snob demographic?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: