View Single Post
  #8   Report Post  
Posted to microsoft.public.word.formatting.longdocs
LeroyLi LeroyLi is offline
external usenet poster
 
Posts: 4
Default How does MS Word arrange the inter word space?

On Nov 5, 8:32 pm, "Robert M. Franz (RMF)"
wrote:
Hello Leroy

LeroyLi wrote:

[..]

I think I haven't make my problem clear enough for you. What I need is
not how to get the MS Word work better but the mechanism which MS Word
uses to justify the spaces in a line. The layout model the MS Word
uses. Just like Tex uses glue mechanism to justity the space between
words, what does Word use?


Nah, your description was fine.

It's just that nobody in here has come upon a clear _authorized_
description (that only MSFT could give). Doesn't mean there isn't one,
but it's a strong indicator. microsoft.com is a huge place, though.
Maybe you find something (and hopefully share it with us if you do :-)).

The default justification algorithm's workings are pretty simply,
though: it adds words after each other, with whatever standard space
width is in a font, until one word is too long to fit on the page. Word
then brings the whole word (or parts of it, if it can through hyphens or
hyphenation) to the new page. And expands the remaining spaces on the
line, equally.

Very simple. And brings pretty bad results if you don't hyphenate a lot!

The compatibility option Peter mentions [BTW: I'm not sure it's needed
anymore in Word 2007] does it a lot better, IMHO. If you activate it,
then upon noting a Word doesn't fit anymore on the line, Word starts to
_reduce_ the space width in the whole line to make it fit. I have no
idea what the threshold is (how thin it will make it, I suspect
something around 2/3 of a normal space width, but that's a really wild
guess). When the word suddenly fits like this, the next word starts the
new line. If the threshold is met, the whole word jumps to the next
line, and Word spacing expands as before.

Not much more intelligent, but the results are far better IMHO.

Now, it's still a very "dumb" algorthm, sort of, since it doesn't look
back and forth in the paragraph. And the automatic hyphenation approach
is not cleverer.

I have no idea how LaTeX does it, but it usually looks better.

That's why, in Word, I prefer to manually hyphenate texts where I can
justify the time for a proper pagination. [This includes texts w/o
horizontal justification, btw.]

2cents
Robert
--
/"\ ASCII Ribbon Campaign | MS
\ / | MVP
X Against HTML | for
/ \ in e-mail & news | Word


Thanks for your replying.
I agree that Word will expand the remaining space equally. Yet there
remains a problem: how dose Word determin the original spaces between
two words when there is no need to expand spaces?
I have worked on this these days, and guessed that these original
spaces is defined in the TrueType font which is the MS' default font.
Now I need to read the Times New Roman font file to find the original
spaces. Oh, God! I need to find some introduction or specification to
help me. This is really a heavy work.