- From: Simon Sapin <simon.sapin@exyr.org>
- Date: Mon, 04 Mar 2013 16:33:00 +0100
- To: Adam Prescott <adam@aprescott.com>
- CC: www-style@w3.org
Le 02/03/2013 23:50, Adam Prescott a écrit :
> As you all know, the @font-face rule allows a new font-family name to
> be defined, and the src property defines where the font can be found.
> However, there is no way to "chain" @font-face rules together, I
> believe. If there is, I couldn't find it in the current CSS Fonts
> module spec.
If I understand correctly, you’d like something like an additional
webfont() function (or one with your favorite name) for the 'src'
descriptor of @font-face rules, to refer to other @font-face rules.
This is probably not impossible, but as you note there are many corner
cases to get right: if one of the web fonts fail to load, if web fonts
refer to each other in a cycle, …
> Let me give a use-case, which I described in a blog post elsewhere[1].
>
> Google Web Fonts (or some other third party) may have provided a
> @font-face rule via a <script> or @import, which would have the effect
> of giving this CSS:
>
> @font-face {
> font-family: FooBar;
> src: local("Foo Bar"), url("...") format("...");
> }
>
> In your own CSS, you may wish to use unicode-range to restrict the
> styling of FooBar to only certain characters (in this case, &):
>
> @font-face {
> font-family: Baz;
> src: local("FooBar"); /* doesn't work */
> unicode-range: U+26;
> }
Is this case, I think the fix really should be for Google to allow you
to specify unicode-range for the CSS they generate in Web Fonts. This
issue does not exist if you control all stylesheets.
I’m not convinced there is a use case strong enough to justify the
complexity in CSS itself.
--
Simon Sapin
Received on Monday, 4 March 2013 15:33:27 UTC