text-align-{07,08}

In the telcon today, I suggested unapproving text-align-07-t and
text-align-07-b based on my flip-flopping understanding of the test.

I just now had a look at the css3-linebox spec, which defines baseline
alignment for CSS boxes.  I think now that we can have the behaviour
that text-align-07-t requires, but I want to make sure that it is
reasonable to have it as the default.  There is a good discussion of
baseline stuff here:

  http://dev.w3.org/csswg/css3-linebox/#baseline

One difference I note between css3-linebox and SVG 1.1 is that the
initial value of alignment-baseline in the CSS spec is baseline while in
SVG it is auto.  alignment-baseline defines how a child box is aligned
with its parent.  A value of baseline means that a child element has its
dominant baseline aligned with the dominant baseline of its parent.
If this is indeed the initial value, it would give text-align-07-t the
effect shown in this reference image:

http://dev.w3.org/cvsweb/~checkout~/SVG/profiles/1.1F2/test/png/text-align-07-t.png?rev=1.2&content-type=image/png

where each of the three text runs are aligned by their alphabetic
baseline (since that is the dominant baseline of the <text> and both of
the <tspan>s), and the non-alphabetic-aligned glyphs within each run of
text are positioned relative to the alphabetic baseline according to the
font size.

In SVG, alignment-baseline’s initial value of auto is confusingly
defined as:

  The value is the dominant-baseline of the script to which
  the character belongs - i.e., use the dominant-baseline of the parent.

css3-linebox doesn’t have a value auto, but it does have a value
use-script, which seems like it’s meant to be the same kind of thing SVG
is defining with auto.  Its definition is:

  If the element ‘text-script’ property value is ‘auto’, the alignment
  point of each glyph is aligned with the parent baseline-identifier of
  the script to which the glyph belongs. If the element ‘text-script’
  property value is other than ‘auto’, the alignment point of each glyph
  is aligned with the parent baseline-identifier of the script specified
  by the ‘text-script’ property. The parent baseline-identifier position
  is determined by using the baseline information appropriate to the
  determined script within the parent dominant-baseline set.

Now SVG doesn’t have a text-script property (and I can’t actually find a
definition of it in css3-text) so let’s assume it is auto.
alignment-baseline:use-script would mean that each glyph in the <tspan>s
would be aligned to the appropriate baseline of the parent <text>
element.  That would be the behaviour required by the test, as shown by
the current reference image:

http://dev.w3.org/cvsweb/~checkout~/SVG/profiles/1.1F2/test/png/text-align-07-t.png?rev=1.3&content-type=image/png

So my current belief is that the test is correct to require this
behaviour because SVG’s alignment-baseline has an initial value of auto,
and this property isn’t explicitly set in the test.  However, having
different initial values across CSS and SVG seems like a bad thing.
What I want to know is which of these two values is a more normal text
layout behaviour.  (My completely evidenceless guess would be
alignment-baseline:baseline, but those in the CSS WG who have experience
with mixing different scripts would be in a better position to answer
this question.)  The second bad thing is the difference in value name:
auto in SVG and use-script in CSS.

Either way, I think CSS and SVG should be aligning(!) here.

-- 
Cameron McCormack ≝ http://mcc.id.au/

Received on Thursday, 20 January 2011 02:48:18 UTC