W3C home > Mailing lists > Public > www-style@w3.org > March 2015

Re: [css-text] useful 'hanging-punctuation: last' characters

From: Brad Kemper <brad.kemper@gmail.com>
Date: Sun, 29 Mar 2015 21:03:08 -0700
Cc: fantasai <fantasai.lists@inkedblade.net>, "www-style@w3.org" <www-style@w3.org>
Message-Id: <00AD6AD8-3FD4-46C8-9D7E-F8219159FDB7@gmail.com>
To: "Liam R. E. Quin" <liam@w3.org>


> On Mar 29, 2015, at 6:20 PM, Liam R. E. Quin <liam@w3.org> wrote:
> 
> On Sat, 2015-03-28 at 21:59 -0700, Brad Kemper wrote:
>>> On Mar 28, 2015, at 2:45 PM, fantasai <
>>> fantasai.lists@inkedblade.net> wrote:
>>> 
>>>>> On 03/28/2015 09:50 AM, Brad Kemper wrote:
>>>>> 
>>>>> On Mar 18, 2015, at 10:39 PM, fantasai <
>>>>> fantasai.lists@inkedblade.net> wrote:
>>>>> 
>>>>>> On 03/18/2015 02:08 AM, Koji Ishii wrote:
>>>>>> 2015/03/11 2:42 "Brad Kemper" < brad.kemper@gmail.com<mailto:
>>>>>> brad.kemper@gmail.com>>:
>>>>>> 
>>>>>>>   I would like the characters that can hang on the end of 
>>>>>>> a line to include a colon. The use case is common when you 
>>>>>>> have
>>>>>>>   right aligned labels ending in a colon.  It looks weird 
>>>>>>> when the lines wrap and the last word doesn't line up with 
>>>>>>> the
>>>>>>>   other words.
>>>>>>> 
>>>>>>>   Could colons be part of the hanging characters in 
>>>>>>> 'hanging-punctuation: last'? Or could there be a new 
>>>>>>> value, such as
>>>>>>>   'hanging-punctuation: last-loose', that hangs the 
>>>>>>> characters in the [Po] category?
>>>>>> 
>>>>>> I think it depends on author choices, scripts, etc. For 
>>>>>> instance, Japanese will not want colons to be included.
>>>>>> 
>>>>>> I would like properties for finer controls be done in Level 
>>>>>> 4. fantasai?
>>>>> 
>>>>> I'm not sure this is a case for hanging punctuation:
>>>>> you don't want the colon to be in the margin, you
>>>>> still want it to take up space. But you want it to be
>>>>> in a separate "column" in the layout.
>>>> 
>>>> I'd be very happy to have it hanging in the right padding,
>>>> actually, so that everything else lined up on the right.
>>>> Or do you mean I wouldn't really get that anyway, due to
>>>> variable kerning, etc. between the colon and the second
>>>> to last letter?
>>> 
>>> If you have a table of words with 8px gap between each cell,
>>> you don't want the cells that happen to end in a colon to have a 
>>> 4ox gap because the colon is in the gap.
>> 
>> Sure I do. In my use case, if there is a gap or padding, it is both 
>> for spacing the labels and for accommodating the colon. It is a case 
>> where every label on the left typically ends in a colon, and even 
>> those that don't should like up with the rest of the text, not with 
>> the colon.
>> 
>> I'd be fine if it was a new value that caused this, so that it 
>> didn't interfere with other use cases.
>> 
>>> You want extra padding corresponding to the colon to be added
>>> to the lines in that cell that don't end in a colon.
>> 
>> That would work too, I guess.
> 
> People used to do this in Quark with a colon that was coloured the 
> same as the background, or effectively transparent. Some more CSS-like 
> ways to do it (and less likely to affect selection, searching, and 
> image backgrounds) might be

I remember doing that sort of thing in QuarkXpress, but only because I controlled the line breaks more precisely than I would in a flexible layout. 

> (1) to access the width of another element that's already been 
> rendered (i.e. earlier in the document), so that you could have a rule 
> like 
>  "th span.colon-width has width of element span#colon"
> Implementos are probably running and hiding...
> 
> (2) A property to say "this element's width is ignored for box 
> calculations" and put the the colon in a span with that property. Can 
> also be used for overprinting.

Yeah, if there was a span around the colon I could abs pos it. Most frequently though, I am unlikely to have that level of control over the source code. It's really a presentational effect that shouldn't require rewriting the source. 

A '::last-letter pseudo-element would be cool for that, but I'm not holding my breath. 

Occasionally the colon is missing, and I can add it in with '::after', and then I can control it more.  

> (3) A property to add a list of characters/glyphs to hung punctuation 
> within an element - you have to watch for a colon other than the one 
> at the end of the paragraph, though, as that one should not hang.
> 
> Overall I'd favour (3) for this problem, optionally with a percentage 
> for how far to hang the character,

Yeah, that would be cool. Even if it only applied to the last character. 

> andyoud still have to put the colon 
> in a span element or something.

Requiring a span around it makes it much much less useful to me. But if that's just to avoid hanging other colons that aren't last, that's rarely a problem for form labels, in my experience. 
Received on Monday, 30 March 2015 04:03:42 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:30 UTC