W3C home > Mailing lists > Public > www-style@w3.org > May 2012

Re: [css3-text] interaction of hanging-punctuation:force-end, text-align and text-justify

From: Florian Rivoal <florianr@opera.com>
Date: Fri, 04 May 2012 23:02:59 +0200
To: www-style@w3.org
Message-ID: <op.wdsx29e14p7avi@eeeflorian>
On Fri, 04 May 2012 20:23:25 +0200, Koji Ishii <kojiishi@gluesoft.co.jp>  

>> From: Florian Rivoal [mailto:florianr@opera.com]
>> If I am reading the spec right, when the hanging-punctuation property  
>> is set to force-end,
>> and text-align is left in ltr text or right in rtl text, if effectively  
>> causes a single line to be
>> justified.
> No it does not. It first defines what characters can hang and when for  
> each value, then the next paragraph defines what the "hang" means in  
> this context:
> | When a punctuation mark hangs, it is not considered when
> | measuring the line's contents for fit, alignment, or justification.
> This feature may require you to change the way you think slightly. It  
> defines how UA measures the line's content, and punctuation hangs as a  
> result of that.
>> The spec does not say if this single line justification is expected to  
>> follow the justification
>> method determined by text-justify or not. I think it should follow  
>> text-justify.
> Correct. It doesn't affect text-justify, text-align, or any other  
> properties.
>> If text-align is justify, my understanding is that  
>> hanging-punctuation:force-end and
>> hanging-punctuation:allow-end would give the same result. Is that  
>> correct?
> Example 17 shows how "allow-end" and "force-end" differ from each other.  
> "force-end" measures the line without stop or comma even if it fits,  
> while "allow-end" does so only if it doesn't fit.

I am confused: Does example 17 assume that text-align is set to left or to  
justify? If I understand you correctly, it assumes that text-align is  
justify. Do you mean that if it had been left, this would happen:

text-align:left; hanging-punctuation:none;
|ab cde,   |
text-align:left; hanging-punctuation:force-end;
|ab cde    |,

If yes, the exsting example should be modified so that its style reads "p  
{text-align:justify;hanging-punctuation:force-end;}", and the case with  
text-align:left should be shown as well.

If that's not what you mean, then what do you mean?

>> If text-align is right in ltr text or left in rtl text, I am not  
>> entirely sure what the expected
>> behavior is. In the following examples, the '|' character marks where  
>> the padding starts.
>> text-align:right; hanging-punctuation:none;
>> |      some words.|
>> text-align:right; hanging-punctuation:force-end;text-justify:inter-word;
>> |       some words|.
>> [...]
>> The first interpretation shifts the line.
> The first one, because what the property changes is how UA measures the  
> content. UA measures the line without the ending stop, then align right.
> If you use "allow-end" against this example, it has no effect, because  
> the line fits without hanging.

I am happy with this behavior, but I don't think the text makes that very  

>> If text-align is center or <string>, I am even more at loss when trying  
>> to imagine what the
>> expected behavior is.
> I hope it's clear now, UA measures string without the ending stop, and  
> center the line, if "force-end".

Do you mean this?

text-align:center; hanging-punctuation:force-end;
|    ab c de    |,

text-align: "." center; hanging-punctuation:force-end;
|  1234.56    |,
|     1.2     |,
Received on Friday, 4 May 2012 20:58:15 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:15 UTC