Bug 36011 - Setting word-spacing on justified blocks removes justification
Summary: Setting word-spacing on justified blocks removes justification
Status: NEW
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: general (show other bugs)
Version: trunk
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-04 05:16 UTC by Manuel Mall
Modified: 2012-04-07 01:51 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel Mall 2005-08-04 05:16:26 UTC
Use the second set of test cases attached to Bug #36010 as an example. When
setting word-spacing="0pt" (which should (nearly) be the same as
word-spacing="normal" or no word-spacing at all) the block is not justified.
Same applies for the word-spacing="-3pt" example. However, word-spacing="normal"
works fine as does something like <fo:block text-align="justify"
word-spacing.optimum="6pt" word-spacing.minimum="3pt" word-spacing.maximum="12pt">.
Comment 1 Luca Furini 2005-08-04 10:19:53 UTC
I'm not sure whether this behaviour is wrong.

The recommendation (7.16.8) states that
 "<space> 
  This allows the user to specify a range of adjustments in addition to the
  default space between words.
  The minimum and maximum values specify the limits of the adjustment."

Setting word-space="0pt" (which means .minimum="0pt", .optimum="0pt",
 .maximum="0pt") you tell the application that there is no possible space 
adjustment, so there is no way to justify the text, unless adjusting 
explicitly-set letter-spacing.

But I could just be wrong, is there any clarifying opinion?
Comment 2 Manuel Mall 2005-08-04 10:30:34 UTC
Luca,

interesting point. It was my understanding from the reading of the spec that
"normal" and "0pt" are virtually the same:

For "normal": .optimum = ("the normal inter-word space, as defined by the
current font and/or the UA" - "the inline-progression-dimension of the
glyph-area obtained by formatting the fo:character") / 2, .maximum = .optimum,
.minimum = .optimum, .precedence = force, and .conditionality = discard.

For a <length>: .optimum = <length> / 2, .maximum = .optimum, .minimum =
.optimum, .precedence = force, and .conditionality = discard.

These two formulas would give the same values for length="0pt" assuming "the
normal inter-word space, as defined by the current font and/or the UA" is the
same as "the inline-progression-dimension of the glyph-area obtained by
formatting the fo:character".

But when specifying "normal" the block is properly justified.
Comment 3 Jeremias Maerki 2005-08-04 10:38:11 UTC
The spec contains many comments that these feature are very user agent-
dependant. So I think we have some liberty (or uncertainty) on how we 
implement this. IMO text-align="justify" should probably override a 
restricting word-spacing setting. In this case it should probably simply 
contribute minimum and optimum values but not allow the maximum constraint to 
restrict the stretchability necessary for the justification.
Comment 4 Manuel Mall 2005-08-04 10:47:27 UTC
Yes, the spec gives quite a bit of leeway to the UA. Are you saying it is
probably OK that the cases word-spacing="normal" and word-spacing="0pt" produce
different output (with respect to justification)? I am quite unsure about that.
Comment 5 Jeremias Maerki 2005-08-04 10:58:15 UTC
I'm unsure, too, but indeed, reading the thing again, word-spacing="0pt" and 
word-spacing="normal" seem to be the same. The space is in addition (!) to the 
normal spacing so it should not really be a real interaction with the spacing 
generated by text-align="justify". The spec says that there "may be 
implementation-specific limits" when word-spacing is negative. I still think 
that justification mostly overrides word-spacing if its restrictions cannot be 
met.
Comment 6 Luca Furini 2005-08-04 11:32:26 UTC
Maybe there is a case (although unlikely, I must admit!) which could make 
significant to have word-spacing="0pt" != word-spacing="normal"

Let's suppose I want some text to be justified modifying only the letter 
spaces, while I desire word-spaces to have all the same width: I would easily 
set letter-spacing.minimum, .optimum and .maximum as I wish, and word-
spacing="0pt".

But if word-spacing="0pt" is the same as "normal", to avoid word space 
adjustment I should set word-spacing.minimum="Xpt", .optimum="0pt" 
and .maximum="-Y", where X and Y are meant to "undo" the stretch and shrink of 
a word space (which are application dependent, so I could not know them).

To be more clear: I thought that a word space min-opt-max values come from the 
size of a space character, let's call it W, according to the font; if the 
property "word-spacing" is explicitly set, then the resulting min-opt-max size 
is:
  W + .minimum, W + .optimum, W + .maximum
while when word-spacing is "normal" we use some hard-coded, default values, 
obtaining:
  W + UA.min, W + UA.opt, W + UA.max

But if I don't succeed in convincing you, I won't insist :-)
Comment 7 Jeremias Maerki 2005-08-04 11:57:59 UTC
As I said, I'm unsure about this. Simply the fact that there is an enum 
value "normal" for word-space and the default is not "0pt" suggests that 
you're probably right and "normal" may indeed have a different meaning. Let's 
simply make sure all the variants are documented using test cases. They are so 
precious in discussions like these. I almost sound like I'm obsessed with test 
cases, but then I probably am. :-)
Comment 8 Manuel Mall 2005-08-04 12:11:18 UTC
Luca, your interpretation seems reasonable but I interpreted the spec to suggest
for the "normal" case: .maximum = .optimum and .minimum = .optimum. This appears
to be in conflict with your interpretation that allows for .maximum <> .optimum
and .minimum <> .optimum in the "normal" case. Of course being so new to all of
this I won't insist either :-).
Comment 9 Chris Bowditch 2005-08-04 12:30:38 UTC
I tend to agree with Luca here. If text-align="justify" then it is perfectly 
reasonable that word spacing is adjusted and if the user has specified a word-
spacing min/max with no leeway then justification may not work.

This seems reasonable as word-spacing is an advanced setting and so users who 
change it should be aware that it may have ramifications on justification.

Another way of looking at this is text-align="justify" is the case where word-
spacing="0pt" != word-spacing="normal" Again, this seems reasonable.

I am inclined to reject this bug, but perhaps we should wait for opinions from 
other committers first.
Comment 10 Glenn Adams 2012-04-07 01:41:50 UTC
resetting P2 open bugs to P3 pending further review