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

John Hudson wrote:

> Jonathan Kew's comment suggests that user agents should be able to match
> a localised name based on platform or document language settings. I can
> imagine all sorts of ways in which that could go wrong or produce
> inconsistent results in different browsers.

A localized *family* name, yes, but not a localized fullname (or family +
style name combination).  So 'Arial Fett' should *never* match.

Unfortunately, on GDI even localized family name matching is a bit of a
mess, it's often dependent on the default script of the OS, so the same
browswer on the same OS but with a different default script will match
differently. OSX has similar issues. The DirectWrite API matches
correctly independent of the underlying script/locale of the OS.

There are also tests in the CSS 2.1 test suite for this (which Webkit doesn't pass
on all platforms):

http://test.csswg.org/suites/css2.1/20110111/html4/font-family-name-010.htm

As a sidenote, the definition of the 'src' description of the @font-face
rule in CSS3 Fonts is specifically defined to explicitly avoid matching
localized fullnames, the English name is used as a canonical form for
lookups.  This is to avoid both the poorly defined or underspecified
platform API's in this area and also to avoid versioning problem (i.e.
there are a lot more localized names in the Windows 7 version of Arial
than in the XP version and the newly added localized names will only
match under Windows 7, even though the actual font (e.g. 'Arial Bold')
may exist).

Cheers,

John Daggett

Received on Tuesday, 13 December 2011 05:29:33 UTC