W3C home > Mailing lists > Public > www-style@w3.org > January 2012

Measures depending on used font (was: A CSS equivalent of HTML's DOCTYPE trigger)

From: Christoph Päper <christoph.paeper@crissov.de>
Date: Sun, 15 Jan 2012 13:29:23 +0100
Message-Id: <8BE1247C-FC73-4B4D-9AA2-88945CC02080@crissov.de>
To: "www-style@w3.org Style" <www-style@w3.org>
Matthew Wilcox (2012-01-10 09:28):

> The issue in there was that type measures (the margin, padding etc we apply to elements that have text in them) should be adjusted depending on the actual typeface in use. We currently set them as concrete values based on the preferred font, but if that font isn't available then the next in the font stack is unlikely to be suitably close and therefor the measures need adjusting. CSS doesn't have that type of logic or workflow.

Honestly, I don’t think it would be worth it. People who care about typographic details like this will usually provide the preferred font via ‘@font-face’ and set ‘em’-based measures accordingly. With that designers can almost almost pretend that webpages were static media. The fallback fonts, properly adjusted by ‘font-size-adjust’ and carefully chosen to have similar metrics, are just that, a fallback, which doesn’t need the highest level of fine-tuning.

Anyhow, what would you imagine the syntax to be like?

  foo {
    font-family: Helvetica, Arial, sans-serif;
    bar: 1em;/* fallback */
    bar: 1em @ Helvetica, 1.1em @ Arial;
  }
  baz {
    quuz: 2em;
    quuz: 2em @ Helvetica, 2.1em @ Arial;
  }

  foo {
    font-family: Helvetica, Arial, sans-serif;
    bar: 1em;/* fallback */
    bar: 1em !for(Helvetica);
    bar: 1.1em !for(Arial);
  }
Received on Sunday, 15 January 2012 12:30:20 GMT

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