Re: [css3-text] vertical-align and shaping

On 10/9/14 08:37, Tab Atkins Jr. wrote:
> On Tue, Sep 9, 2014 at 6:16 PM, John Daggett <jdaggett@mozilla.com> wrote:
>> Tab Atkins wrote:
>>>> For example, I don't see any reason why the two pieces of markup
>>>> below should be shaped differently:
>>>>
>>>>    <span>A</span><span>W</span>
>>>>    <sup>A</sup><sup>W</sup>
>>>>
>>>> I don't see any reason why the kerning applied between the letters
>>>> in adjacent spans should not be used between adjacent superscript
>>>> elements.
>>>
>>> Because they're effectively different words, semantically.  And
>>> this is far more than kerning - you don't want those two to
>>> ligaturize, or affect character shapes in Arabic, etc.
>>
>> I don't really see how "semantically" different somehow implies
>> coalescing can occur in one case but not in another. Worse, using a
>> presentation attribute like 'vertical-align' is a poor way to infer
>> that somehow inlines are distinct.
>>
>> Example - a simple 1px bump in the baseline breaks kerning and ligatures:
>>
>>    .shift-up span { vertical-align: 1px; }
>>
>>    <p><span>A</span><span>W</span> <span>f</span><span>i</span></p>
>>    <p class="shift-up"><span>A</span><span>W</span> <span>f</span><span>i</span></p>
>>
>> Why should kerning and ligatures be used in one of these but not the other?
>>
>> I don't think there's any real use case that you're solving by
>> introducing this "non-baseline values of vertical-align disables
>> coalescing" rule. In the absence of a real need, CSS should strive
>> to avoid special-case rules like this that complicate
>> implementations unnecessarily and result in odd behavior for authors.
>
> There is a very real need.  Words sometimes have multiple
> superscripts.  In languages where it matters, these should not join.
> For example, say you have multiple footnotes at one point, and you're
> using letters as footnote indicators, like foo^ABC in English. In
> Arabic, each of the letters should be using the "isolated" shape, but
> if superscripts aren't automatically a break, they'll instead form a
> word, with A, B, and C being in initial/medial/final shapes instead;
> it'll look nonsensical.

I don't find this very convincing. If there are multiple superscripts, 
they would/should normally be separated or delimited somehow, in English 
just as much as in Arabic; I'd expect to see commas between them, or a 
thin space, or something like that.

Consider the case of numeric superscripts: Does 
foo<sup>1</sup><sup>2</sup><sup>3</sup> mean foo^{123} or foo^{1,2,3}? 
ISTM it should mean the latter. Something like

   sup + sup::before { content: ','; }

could achieve this, and a similar approach would be equally applicable 
to alphabetic superscripts, whether English or Arabic.

JK

Received on Wednesday, 10 September 2014 08:59:45 UTC