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

"Richard Fink" <[email protected]>
Newsgroups gmane.comp.web.fonts,gmane.comp.web.css.general
Message-ID <002401cb53fa$ad7d98d0$0878ca70$@com>
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: [email protected] [mailto:[email protected]] On Behalf Of John Daggett
Sent: Tuesday, September 14, 2010 5:27 AM
To: Sergey Malkin
Cc: [email protected]; 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.