Thanks for the hint -- I'll do a diff next time. ;)  I'm new to all
this, so please forgive any newbie mistakes.

I think I've figured out why the ALIGNMENT_JUSTIFY will sometimes not
justify a given line.  The AlignText function is saying that the line
will not be justified if the line length is less than 25% of the maximum
line length.  I assume this assumption is to catch the last line of a
paragraph, but this also means that if a line is wrapped because of a
long word at the end (ie, "blah blah supercalifragilistic..."), the
"blah blah" will not be justified.  I think if a new global flag is
added ("paragraphEnded") and set to true when a 'newline' or
PARAGRAPH_END token is encountered, you could check that flag explicitly
in AlignText instead of assuming a short line to be the end of the
paragraph.  I'll tinker with it to see if this idea will work.

Thanks!

- Jamis

On Mon, 2002-04-29 at 10:46, Adam McDaniel wrote:
> On Sun, Apr 28, 2002 at 08:28:59PM -0600, Jamis Buck wrote:
> > Okay -- I've attached the single function I modified (GetLineMetrics,
> > in paragraph.c).  I have commented the portions I modified.  Please let
> > me know if it does cause any problems -- I would really like to see this
> > added.  The only potential problem I can see is if the hyphen character
> > is the first character in a word (ie, a unary negative).  I haven't
> > completely thought through how the code will behave in that case.
> 
> I can try running it. In the future though, it would be better to make
> a diff rather than send the whole function. It's easier for ppl who are
> re-creating the environment to inject diffs into the original to try it
> out. 
> 
> > On another note -- I've noticed that ALIGNMENT_JUSTIFY does not work in
> > every case; i.e., in some instances, a line will not be justified, but
> > the preceding and following lines will be.  Is this a known bug, or
> > should I investigate it further?  (I've noticed it in the CVS snapshot I
> > downloaded today.)
> 
> I believe for ALIGNMENT_JUSTIFY to work, it must be specified in the
> pdb by the parser. However, a whole paragraph should maintain the same
> type of justification. If one line isn't, then it may be a bug.
> 
> By all means, invesitage further :)
> 
> -- 
> Adam McDaniel
> Array Networks
> Calgary, AB, Canada
-- 
Jamis Buck
[EMAIL PROTECTED]
http://hippa-potta.jamisandtarasine.net
.
"I'd horsewhip you if I had a horse." -- Groucho Marx

Reply via email to