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

Re: [css3-fonts] @font-face font-family names used in other @font-face rules

From: Adam Prescott <adam@aprescott.com>
Date: Wed, 6 Mar 2013 22:36:33 +0000
Message-ID: <CA+OJs9SDsfJMzWZaoxW6q=tyZrdUDhZjnZKgn1q+vA=DbxAfnA@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: John Daggett <jdaggett@mozilla.com>, www-style list <www-style@w3.org>
On 6 March 2013 22:10, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> I'm apparently missing something.  Again, *aside* from unicode-range,
> what do you want to "override" from another @font-face rule?

I'll try to restate it more clearly.

There are two related aims.

Firstly: given an existing @font-face rule defined by someone else's
CSS that is outside of your control, the goal is to restrict it with
unicode-range without a src value of local() or url(). More
explicitly, if "Wendy One" is defined in @font-face CSS given by
someone else (in this case Google, but it could be any other host):

    /* Contains a @font-face rule for font-family: "Wendy One" */
    @import url(http://fonts.googleapis.com/css?family=Wendy+One);

Then this attempt is invalid and does not work, because there is no
src property:

    /* Attempting to restrict the @font-face from the @import to only U+0026 */
    @font-face {
      font-family: "Wendy One";
      unicode-range: U+26;
    }

    /* A "Wendy One" ampersand, all other characters in "My Other Web Font" */
   p { font-family: "Wendy One", "My Other Web Font", serif; }

Secondly, and related to the above: as a refinement, with the same
situation as above, if you wished to use a more explicit, refined name
like "Ampersand" (to make it very clear what its purpose is), then,
again with a @font-face rule defined by someone else's CSS outside of
your control, this hypothetical "chaining" is currently not possible:

    @import url(http://fonts.googleapis.com/css?family=Wendy+One);

    @font-face {
      font-family: "Ampersand";
      font-family-src: "Wendy One";
      unicode-range: U+26;
    }

    /* A "Wendy One" ampersand, more clear in its purpose,
       all other characters in "My Other Web Font" */
    p { font-family: "Ampersand", "My Other Web Font", serif; }

You cannot refer to web fonts in this way, as you yourself said -- it's invalid.

Requesting that Google include unicode-range in its CSS would allow
things to be at least *functional* even without the "refined" name of
"Ampersand". Other hosts would have to allow the same, though. If they
allowed specifying the font-family value specifically for this
purpose, then yes this would meet both aims. Again: others would have
to do the same.
Received on Wednesday, 6 March 2013 22:37:21 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:06 GMT