RE: [css3-fonts] @font-face matching and font-style descriptor

Sergey Malkin wrote:

> One more clarification is needed, though, regarding use of
> artificial styles. In case where font-style descriptor is not
> specified, spec says "default values are assumed". What is default
> value? Is this equivalent to specified "font-style:normal"?
> 
> Consider following example:
> 
> @font-face { 
>   font-family: MyFont1;
>   src: local(Arial);
> }
> 
> @font-face { 
>   font-family: MyFont2;
>   src: local(Arial);
>   font-style:normal;
> }
> 
> Will following two lines be rendered identically? They will both use
> regular Arial face. But will each of them be allowed to use
> generated oblique font?
> 
> <div style="font-family:MyFont1; font-style:italic;">Abc</div>
> <div style="font-family:MyFont2; font-style:italic;">Abc</div>

I, too, would expect an italic to be synthesized in both cases, absolutely.
And I believe the majority of web authors would implicitly assume the same, as well. Anything else would feel like a departure. It would be puzzling.

Regards,
Rich



-----Original Message-----
From: www-font-request@w3.org [mailto:www-font-request@w3.org] On Behalf Of John Daggett
Sent: Tuesday, September 14, 2010 5:27 AM
To: Sergey Malkin
Cc: www-style@w3.org; www-font; Sylvain Galineau
Subject: Re: [css3-fonts] @font-face matching and font-style descriptor


Sergey Malkin wrote:

> One more clarification is needed, though, regarding use of
> artificial styles. In case where font-style descriptor is not
> specified, spec says "default values are assumed". What is default
> value? Is this equivalent to specified "font-style:normal"?
> 
> Consider following example:
> 
> @font-face { 
>   font-family: MyFont1;
>   src: local(Arial);
> }
> 
> @font-face { 
>   font-family: MyFont2;
>   src: local(Arial);
>   font-style:normal;
> }
> 
> Will following two lines be rendered identically? They will both use
> regular Arial face. But will each of them be allowed to use
> generated oblique font?
> 
> <div style="font-family:MyFont1; font-style:italic;">Abc</div>
> <div style="font-family:MyFont2; font-style:italic;">Abc</div>

The default value of descriptors in @font-face rules are listed as the
"Initial value", i.e. the value specified if no descriptor is
explicitly defined.  The initial values of font-style descriptors is
"normal", so the two rules you've defined are equivalent.  User agents
will synthesize an italic face if needed.

As for *how* a user agent does this, I think there are a number of
weird edge cases.  For example:

@font-face {
  font-family: MyFont3;
  src: local(Arial Italic);
  font-style: normal;
}

Should the browser add extra oblique to an already italic face if it's
the single "normal" face defined for a family?  I think it probably
makes sense to allow user agents to treat already italicized font data
as a "synthesized" version.  I don't think we should have a
conformance requirement that user agents oblique already
italic faces.

Tab Atkins Jr. wrote:

> It should probably say "initial value", which is defined for every property.

Agreed, although I would note these are *not* properties but descriptors.

Regards,

John Daggett

Received on Tuesday, 14 September 2010 10:51:07 UTC