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

Re: [css21] Make font weight mapping rules normative

From: John Daggett <jdaggett@mozilla.com>
Date: Tue, 30 Mar 2010 22:54:39 -0700 (PDT)
To: www-style <www-style@w3.org>
Message-ID: <1937069988.68504.1270014879043.JavaMail.root@cm-mail03.mozilla.org>

Just a follow-up to today's F2F discussion of font weight mapping:
http://krijnhoetmer.nl/irc-logs/css/20100330#l-777

> jdaggett: I wanted to go over one thing that was discussed yesterday
> jdaggett: There was the question of CSS2.1 font-weight
> http://lists.w3.org/Archives/Public/www-style/2010Mar/0510.html
> jdaggett: The wording of the 2.1 spec now, the 4 bullet points you guys were talking about
> jdaggett: The 4th bullet point is not clear about 400 and 500
> jdaggett: It's clear in case where 400 doesn't exist but 500 does, but not about other cases
> jdaggett: I've clarified this in css3-fonts
> Chris: In that case I suggest we adopt the CSS3 wording in CSS2.1 to keep these consistent
> jdaggett: basically 400 and 500 map to each other, and then they map down
> http://lists.w3.org/Archives/Public/www-style/2010Feb/0279.html
> RESOLVED: accept proposal to use css3-fonts wording about font-weight hole-filling in css2.1

CSS 2.1 font weight matching:

> The association of other weights within a family to the numerical
> weight values is intended only to preserve the ordering of darkness
> within that family. However, the following heuristics tell how the
> assignment is done in typical cases:
> 
>   * If the font family already uses a numerical scale with nine values
>     (like e.g., OpenType does), the font weights should be mapped
>     directly.
> 
>   * If there is both a face labeled Medium and one labeled Book,
>     Regular, Roman or Normal, then the Medium is normally assigned to
>     the '500'.
> 
>   * The font labeled "Bold" will often correspond to the weight value '700'.
> 
>   * If there are fewer then 9 weights in the family, the default
>     algorithm for filling the "holes" is as follows. If '500' is
>     unassigned, it will be assigned the same font as '400'. If any of
>     the values '600', '700', '800' or '900' remains unassigned, they are
>     assigned to the same face as the next darker assigned keyword, if
>     any, or the next lighter one otherwise. If any of '300', '200' or
>     '100' remains unassigned, it is assigned to the next lighter
>     assigned keyword, if any, or the next darker otherwise.

To match the description in the CSS3 Fonts spec, substitute this wording:

The association of other weights within a family to the numerical
weight values is intended only to preserve the ordering of darkness
within that family. However, the following heuristics tell how the
assignment is done in this case:

  * If the font family already uses a numerical scale with nine values
    (like e.g., OpenType does), the font weights should be mapped
    directly.

  * If there is both a face labeled Medium and one labeled Book,
    Regular, Roman or Normal, then the Medium is normally assigned to
    the '500'.

  * The font labeled "Bold" will often correspond to the weight value '700'.

If a font family lacks a matching weight for a given desired weight, a
weight is selected as follows:

  * If the desired weight is less than 400, weights below the desired
    weight are checked in descending order followed by weights above the
    desired weight in ascending order until a match is found.

  * If the desired weight is greater than 500, weights above the
    desired weight are checked in ascending order followed by weights
    below the desired weight in descending order until a match is found.

  * If the desired weight is 400, 500 is checked first and then the
    rule for desired weights less than 400 is used.

  * If the desired weight is 500, 400 is checked first and then the
    rule for desired weights less than 400 is used. 
Received on Wednesday, 31 March 2010 05:55:12 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:25 GMT