Re: Hanging Punctuation Questions

On 09/25/2016 07:28 AM, fantasai wrote:
> On 03/04/2016 10:39 PM, David Hyatt wrote:
>> I have begun implementing hanging punctuation in WebKit. So far the
>> “first” and “last” values are supported, and “allow-end/force-end”
>> are coming soon. I had a few questions after implementing:
>>
>> (1) Can you only hang one character? That’s what I did, but if
>> there’s a run of characters all in the Ps category should I be
>> hanging them all when hanging-punctuation is “first” or just a
>> single one? (Similar question for “last”.) In my research of
>> typography examples, I do see situations where - for example -
>> a period and quote mark together both get hung.
> 
> The spec currently says
>      “At most one punctuation character may hang at each edge of the line.”
> and for CJK typesetting this is a correct requirement.
> 
> Western typesetting is a bit more complicated because we sometimes
> kern punctuation together, such as your quote-mark + period example,
> which frequently results in a kerned pair.
> 
> So a question would be, if we hang the full unkerned advance width
> of the hung punctuation, would that be sufficient to address this
> case? Or does the full advance of both characters need to hang
> regardless of kerning?
...
>> (4) How to handle kerning, e.g., for hanging-punctuation:first,
>> if I hang an opening quote mark, the next letter may also be offset
>> to the left, since it pushes into the quotation mark. Should kerning
>> simply be turned off when you hang punctuation between the hung
>> punctuation and the following glyph?
> 
> My guess is you subtract the amount of kerning from the amount of hang
> so the character adjacent to the hanging one is aligned according to
> its side bearing. However, we should probably check with people who
> know better. :)

FWIW, CSSWG discussed this in
   https://lists.w3.org/Archives/Public/www-style/2016Oct/0115.html
and concluded that it didn't know for sure what to do, so the interaction
of kerning and hanging-punctuation is now marked as undefined.
   https://drafts.csswg.org/css-text-3/#hanging-punctuation-property

If anyone has further insights on this, let us know, maybe we'll define
it in Level 4. :)

~fantasai

Received on Monday, 5 March 2018 08:29:32 UTC