You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by ar...@cappelino.de on 2004/09/01 16:51:16 UTC

Handling of text-align="justify" when nesting blocks

Hi fopdevs,

if you have time, consider this:

<fo:block text-align="justify">
TEST TEST TEST TEST TEST ..... ENOUGH TEXT TO FORMAT INTO MULTIPLE LINES 
.... TEST ENDS A. 
<fo:block>
whatever
</fo:block>
TEST TEST TEST TEST TEST ..... ENOUGH TEXT TO FORMAT INTO MULTIPLE LINES 
.... TEST ENDS B.
</fo:block>

Now what would you expect:

A:

TEST TEST TEST TEST
TEST ENDS A.
whatever
TEST TEST TEST TEST
TEST ENDS B.

OR

B: (second line is justified)

TEST TEST TEST TEST
TEST      ENDS                 A.
whatever
TEST TEST TEST TEST
TEST ENDS B.

Common sense would probably say A:

But, 7.15.9 of the rec says:

The last (or only) line of any block, and any lines in the block ending in 
U+000A, will be aligned
in accordance with the "text-align-last" property value. If such lines are 
to be justified specify
"text-align-last='justify'".

In the example, line 2 is neither the last nor the only line of a block, 
and it's also not a line ending in U+000A, so it should be justified.

Right?

FOP 0.20.5 does A.

Any opinions?

BTW: you can ignore any whitespace/linefeed-treatement issues here (all 
set to default): the above example formats the same with FOP if you put 
all of it in a single line.

Thanks,

Arnd
-- 
Arnd Beißner
Cappelino Informationstechnologie GmbH

Re: Handling of text-align="justify" when nesting blocks

Posted by Simon Pepping <sp...@leverkruid.nl>.
On Wed, Sep 01, 2004 at 10:10:52PM +0200, arnd.beissner@cappelino.de wrote:
> <fo:block id="outer" text-align="justify">
> TEST TEST TEST TEST TEST ..... ENOUGH TEXT TO FORMAT INTO MULTIPLE LINES 
> .... TEST ENDS A. 
> <fo:block id="inner">
> whatever
> </fo:block>
> TEST TEST TEST TEST TEST ..... ENOUGH TEXT TO FORMAT INTO MULTIPLE LINES 
> .... TEST ENDS B.
> </fo:block>
> 
> The line 2 (.... TEST ENDS A.) is the last line before the block "inner" 
> starts, but it's not the last line of the block with id "outer". The last 
> line of the block "outer" is: (.... TEST ENDS B.).
> 
> Get my point, or am I still being unclear?
> 
> Can we safely assume the rec. means "block area" here instead of just 
> "block"? I think we can't, since then that would mean that the last line 
> on a page (or column) would also be formatted left-aligned instad of 
> justified even if it's not the last line of the block ("block" as in 
> "fo:block").

It sounds like you are right. This would apply to a displayed formula
in a paragraph. Nobody would want a layout in which the last line
before the display is justified, so there seems to be a problem here.

Regards, Simon

-- 
Simon Pepping
home page: http://www.leverkruid.nl


Re: Handling of text-align="justify" when nesting blocks

Posted by ar...@cappelino.de.
"J.Pietschmann" <j3...@yahoo.de> schrieb am 01.09.2004 22:48:17:

> > <fo:block text-align="justify">
> > TEST TEST TEST TEST TEST ..... ENOUGH TEXT TO FORMAT INTO MULTIPLE 
LINES 
> > .... TEST ENDS A. 
> > <fo:block>
> ...
> > In the example, line 2 is neither the last nor the only line of a 
block, 
> > and it's also not a line ending in U+000A, so it should be justified.
> 
> It is the last line in the block. Trailing whitespace util the
> closing tag is normalized away (or should be, FOP shows bugs here).
> Why do you think it is otherwise?

Hm, I think it's not the last line of the block. Let's see my example 
again, but this time with ids:

<fo:block id="outer" text-align="justify">
TEST TEST TEST TEST TEST ..... ENOUGH TEXT TO FORMAT INTO MULTIPLE LINES 
.... TEST ENDS A. 
<fo:block id="inner">
whatever
</fo:block>
TEST TEST TEST TEST TEST ..... ENOUGH TEXT TO FORMAT INTO MULTIPLE LINES 
.... TEST ENDS B.
</fo:block>

The line 2 (.... TEST ENDS A.) is the last line before the block "inner" 
starts, but it's not the last line of the block with id "outer". The last 
line of the block "outer" is: (.... TEST ENDS B.).

Get my point, or am I still being unclear?

Can we safely assume the rec. means "block area" here instead of just 
"block"? I think we can't, since then that would mean that the last line 
on a page (or column) would also be formatted left-aligned instad of 
justified even if it's not the last line of the block ("block" as in 
"fo:block").

Thanks for any input,

Arnd
-- 
Arnd Beißner
Cappelino Informationstechnologie GmbH

Re: Handling of text-align="justify" when nesting blocks

Posted by "J.Pietschmann" <j3...@yahoo.de>.
arnd.beissner@cappelino.de wrote:

> <fo:block text-align="justify">
> TEST TEST TEST TEST TEST ..... ENOUGH TEXT TO FORMAT INTO MULTIPLE LINES 
> .... TEST ENDS A. 
> <fo:block>
...
> In the example, line 2 is neither the last nor the only line of a block, 
> and it's also not a line ending in U+000A, so it should be justified.

It is the last line in the block. Trailing whitespace util the
closing tag is normalized away (or should be, FOP shows bugs here).
Why do you think it is otherwise?

J.Pietschmann