Re: [css3-fonts] Addition of font-size: xxx-large

Ryosuke Niwa:
> >
> >  h6  1   xx-small    0.6rem              9.6px =  7.2pt
> >           x-small    0.75rem            12px   =  9pt
> >  h5  2      small    0.89rem            14.2px = 10.7pt
> >  h4  3      medium   1rem               16px   = 12pt
> >  h3  4      large    1.2rem             19.2px = 14.4pt
> >  h2  5    x-large    1.5rem             24px   = 18pt
> >  h1  6   xx-large    2rem               32px   = 24pt
> >      7  xxx-large    3rem               48px   = 36pt

The exact rounding and capping behavior of implementations was not my point. I just applied the draft recommendations to the frequent base size of 16 pixels.

Anyhow.

> http://trac.webkit.org/browser/trunk/Source/WebCore/css/CSSStyleSelector.cpp?rev=113922#L4920

  Other bases (Todd Fahrner)
  0.60, 0.75, 0.89,   1.0,   1.2,   1.5,   2.0,   3.0

  CSS Level 3
  3/5,  3/4,   8/9,     1,   6/5,   3/2,   2/1,   3/1

That means Webkit matches the Level 3 draft for all user-set base sizes that are not an integer between 9 an 16 pixels. (It rounds 8/9 to 0.89, but that seems reasonable.)

          1      2      3      4      5      6      7  HTML
   xxs   xs      s     _m_     l     xl     xxl        CSS

  CSS Level 3 (round to nearest integer)
    5,    7,     8,     9,    11,    14,    18,    27.
    6,    8,     9,    10,    12,    15,    20,    30.
    7,    8,    10,    11,    13,    17,    22,    33.
    7,    9,    11,    12,    14,    18,    24,    36.
    8,   10,    12,    13,    16,    20,    26,    39.
    8,   11,    12,    14,    17,    21,    28,    42.
    9,   11,    13,    15,    18,    23,    30,    45.
   10,   12,    14,    16,    19,    24,    32,    48.

  Quirks mode
    9;    9;     9;     9,    11,    14,    18,    28:
    9;    9;     9,    10,    12,    15,    20,    31:
    9;    9;     9;    11,    13,    17,    22,    34:
    9;    9,    10;    12,    14,    18,    24,    37:
    9;    9;    10;    13,    16,    20,    26,    40:
    9;    9;    11;    14,    17,    21,    28,    42.
    9,   10;    12;    15,    17;    23,    30,    45.
    9;   10;    13;    16,    18;    24,    32,    48.

  Strict mode
    9;    9;     9;     9,    11,    14,    18,    27.
    9;    9;     9,    10,    12,    15,    20,    30.
    9;    9;    10,    11,    13,    17,    22,    33.
    9;    9,    10;    12,    14,    18,    24,    36.
    9;   10,    12,    13,    16,    20,    26,    39.
    9;   10;    12,    14,    17,    21,    28,    42.
    9,   10;    13,    15,    18,    23,    30,    45.
    9;   10;    13;    16,    18;    24,    32,    48.

          1      2      3      4      5      6      7  HTML
   xxs   xs      s     _m_     l     xl     xxl        CSS

Assuming an implied default minimum font size of 9px, the “Strict mode” deviates from the current draft (i.e. is 1px too small) only for
— ‘small’ at base 12px,
— ‘x-small’ at bases 14px and 15px,
— ‘xx-small’, ‘x-small’ (2px difference), ‘small’ and ‘large’ at base 16px.
It’s of course more than unfortunate that the most and largest differences occur for the most common default font size.

By mere inspection, I couldn’t find a simple rounding behavior that would result in the “Strict” matrix algorithmically. I’m curious which design rationale it originates from since it differs from the “Quirks” variant significantly.

Received on Thursday, 19 April 2012 13:59:24 UTC