W3C home > Mailing lists > Public > www-style@w3.org > June 2010

Re: [css3-fonts] Relationship between OpenType and CSS font names

From: John Daggett <jdaggett@mozilla.com>
Date: Wed, 23 Jun 2010 20:58:47 -0700 (PDT)
To: Sairus Patel <sppatel@adobe.com>
Cc: www-style <www-style@w3.org>, www-font <www-font@w3.org>
Message-ID: <415548037.537695.1277351927474.JavaMail.root@cm-mail03.mozilla.org>
Sairus Patel wrote:

> What I'm hearing is that CSS does not specify how CSS authoring
> software should set font-family, for OpenType fonts.
> Since OT provides several kinds of family names, authoring software
> is essentially on their own.

Strictly speaking, the CSS spec does not declare a given name ID
within OpenType fonts to be the basis for family groupings.  Nor given
the wacky bifurcated model for various family name ID's in the name
table is this actually possible.  The best that can be stated is that
family names in CSS should match given the natural font family
groupings for that platform.

If all platforms had the same set of fonts, that might lead to
confusion but generally there's not a lot of crossover across
platforms. Apple pays to license Helvetica, while Microsoft does not,
it mimics Helvetica and ships it as Arial [1].  Intelligent authoring
tools should probably understand these relationships when creating
font stacks for cross-platform use.

> For example, there is no conformant way to generate font-family when
> using the XP/Vista/Win7 font Arial Black, which has name ID 1 "Arial
> Black" and name ID 16 "Arial". Would you say this is an accurate
> statement?

Again, this really relates to the underlying platform model of family
groupings.  XP has a separate family for Arial Black but under Windows
7 it's a face within the larger Arial family.  On the Mac it's a
distinct family (the name table ID's are different compared to the
Windows 7 version).  So to use the black face of Arial *and*
be backwards compatible you'd need:

  strong {
    font-family: Arial Black, Arial;
    font-weight: 900;
> Note that it woud be acceptable to use the OT 4-face family name
> (name ID 1) for font-family ("Minion Pro SmBd", etc) -- it's just
> the CSS spec doesn't say so. (Remember that GDI is present in Vista
> as well as Windows 7. Also, in my experiments, Mac OS APIs appear to
> match on on name ID 1 with certain caveats.)

Um, acceptable to who exactly?  I think in general users expect that
the family groupings in the font folder are reflected in the way user
agents match font families.  Forcing all families into groupings of 4
is silly frankly, no Mac user agent would ever implement that.

> It would be acceptable even if CSS specified that OpenType's WWS
> (Weight/Width/Slope) family name as specified by name ID 21 and
> OS/2.fsSelection bit 8 is to be used. We know that we'd need to
> parse font tables on XP to get this to work in a UA, but at least
> the CSS spec would be clear, and a UA that needs to call only GDI
> can be justified in not doing a full implementation on GDI.

I think this is the natural direction things are headed, if Windows
name ID 21 == Mac name ID 1 then things will work out the same on all
platforms.  But why *require* this change for XP when XP ships with
no font families that would be affected by this change?

> > Plus there are features in CSS3 that will make the above
> > constraints impossible using only GDI, you need to use some form
> > of OpenType Layout engine.
> Could you please point me to a description of these features?




[1] http://www.ironicsans.com/helvarialquiz/
Received on Thursday, 24 June 2010 03:59:22 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:47 UTC