W3C home > Mailing lists > Public > www-style@w3.org > December 2011

Re: [css3-fonts] what is the right font "family-name"?

From: John Daggett <jdaggett@mozilla.com>
Date: Mon, 12 Dec 2011 18:41:58 -0800 (PST)
To: tao yu <tao.yu@nokia.com>
Cc: www-style@w3.org, jonathan@jfkew.plus.com
Message-ID: <1679379738.22935.1323744118521.JavaMail.root@zimbra1.shared.sjc1.mozilla.com>
> I tried "Arial Bold" as "family-name" on Chrome, it works ok to
> display the text in Bold.  Chrome might be flexible to handle this
> case.  You are right, "Arial Bold" is a face name, not family name.

Webkit browsers have an outstanding bug where they recognize other font
identifiers as well as the family name.  They should only be recognizing
the family name.  The main reason for this is that underneath the covers
GDI is being used and GDI (as opposed to DirectWrite) allows *both*
family name ('Arial') and fullname ('Arial Bold') to be matched.  On
OSX, fullnames are *not* recognized by Webkit but PostScript names
('Arial-BoldMT') are.  You can see a full set of these examples here:


Because of this, Webkit browsers fail these CSS 2.1 test
suite tests:

Webkit fails on Windows:

Webkit fails on OSX:

You should always use a *family* name to match a family and other style
attributes to match a specific style/weight/width combination within the
family, in this case simply:

  font-family: Arial;
  font-weight: bold;

This works everywhere, in both old and new browsers.


John Daggett
Received on Tuesday, 13 December 2011 02:42:35 UTC

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