Hi Folks,
         It's been a long time since a wrote up a POW and this one is not
as clear as others because I'm not quite sure where the problem is.

Basically tabs for anything other than left justification are broken. Just
set to anything other than left justification and place a few tabs on a
line and you'll see.


I'll recap how lines are layed out in the formatter classes. (Jesper
feel free to correct me :-)

1. All the fp_runs are placed on one long line. See fl_BlockLayout.cpp::format()

2. This line is laid out with the layout method of fp_line to set all the
run widths.

3. This line is broken to fit into a container with
fp_LineBreaker.cpp::breakParagraph.

if( there remaining line is of greater width than the container)
        goto 2.

Unfortunately I haven't investigated enough to know exactly where the
bug(s) lie but I'm sure at least one of

abi/src/text/fmt/xp/ 

fp_Line.cpp::layout()

fb_LineBreaker.cpp::breakParagraph(..)

is buggy.

the layout method lays out run of contiguous properties on a line. The
width of a tab run is calculated here but I'm fairly sure no account of
the line justification is made. Another point to make here. The layout
uses the pixel width at screen resolution to place characters and runs on
the screen. If it used layoutunits the text would not look right because
of rounding errors at screen resolution.

breakParagraph simply breaks one long line into a set of lines that fit
in a container. To do this the method needs the width of every run
including tabs. Thus the layout method on the long line needs to called
before breakParagraph is called so that run width calculation is done.

I suspect that tabs for center, right and full justification can be fixed
by fixing the layout() method of fp_Line.

Anyway, good luck to whoever takes this on. This is an embarassing bug
that should be fixed ASAP.

Cheers

Martin



Reply via email to