Re: SVG12: computed value of font-weight vs uDOM

Hello www-svg,

Ian Hickson <ian@hixie.ch> wrote:
> Chris Lilley wrote:
>> It will be a numerical value; the precise value would depend on
>> the font and what weights it provides.
> 
> In that case SVG is incompatible with CSS. Please correct this 
> incompatibility. (See the last few paragraphs of CSS 2.1 section 15.6 to 
> see the formal definition of font-weight's computed value.)

Looking a the latest CSS 2.1
http://www.w3.org/Style/Group/css2-src/fonts.html#font-boldness

I can see that you are referring to

 The computed value of "font-weight" is either:

    * one of the legal number values, or
    * one of the legal number values combined with one or more
      of the relative values (bolder or lighter). This type of
      computed values is necessary to use when the font in question
      does not have all weight variations that are needed.

although leaving aside the slight grammatical clumsiness, what concerns
me is that the same section also says

  Child elements inherit the resultant weight, not the keyword value.

which, assuming that it is the computed value which is inherited, implies
that a value like "100 bolder bolder" is both required and disallowed.
Could you clarify?

And does "combined" mean "concatenated" or "concatenated with spaces in
between" or some other form of combination?

For the sake of discussion, lets pretend that we are using the
"Rattlesnake" font family from the CSS spec. "Rattlesnake Regular"
covers 100, 200, 300 and 400. After all, the precise value would depend
on the font and what weights it provides. Lets use that with your
earlier example, and consult CSS 2.1 to find that:

  'bolder' selects the next weight that is assigned to a font that is
  darker than the inherited one. If there is no such weight, it simply
  results in the next darker numerical value (and the font remains
  unchanged), unless the inherited value was '900' in which case the
  resulting weight is also '900'.

So this means that bolder, bolder from 100 goes "Rattlesnake Medium"
then "Rattlesnake Bold". Does that result in 600 or 700 (the same face
covers both)? It seems that it should take 600. So for this case, the
computed value would be 600.

Given the "filling in the holes" algorithm and the special-casing of
900, in what circumstance would it be the case that "the font in
question does not have all weight variations that are needed"? The
"filling in the holes" ensures that even if there is a single weight, it
covers all weight variations.

If there is a darker font in the same family, you get its numerical
value. If there is not, you get the next number in the series. unless
you are already at 900.

How does the second bullet in the CSS 2.1 definition of computed value
of "font-weight" ever get used?

-- 
 Chris Lilley                    mailto:chris@w3.org
 Interaction Domain Leader
 Co-Chair, W3C SVG Working Group
 W3C Graphics Activity Lead
 Co-Chair, W3C Hypertext CG

Received on Friday, 9 June 2006 20:14:17 UTC