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

Hi Sairus,

> Thanks for your prompt and detailed response, John. Just to be
> clear, this is the scope of the effort I'm involved in:
> a. A user (or authoring tool) creates HTML with CSS that specifies
> an OS-installed font via a {family-name + weight/width/slope
> properties} descriptor or a font-face-name descriptor.
> b. A UA must be able to precisely match the desired font when this
> HTML is viewed on XP and Mac OS, when the desired font is installed
> on those OSes.
> c. The above should work for any reasonably well-formed OT fonts,
> whether or not they ship with the OS. Adobe's font library is a good
> place to start.
> d. The UA must not parse font tables directly, for efficiency
> reasons. The only interface to the font is by OS APIs.
> e. The font descriptor must be cross-platform. That is, a single
> font descriptor must be used for both XP and Mac OS. Multiple font
> descriptors for the same font, one for each platform, are not
> allowed.

These are difficult constraints to satisfy unfortunately.  Each
platform has it's own special voodoo to deal with.  If you're only
using GDI, you're going to have trouble matching preferred family
names, since as you know GDI provides no way of sniffing the preferred
family name without reading tables.  Localized family names will not
work in all locales, since GDI matching is based on locale (e.g.
Japanese font names will only match when the Windows system locale is
Japanese, play around with Kozuka Gothic Pro). Similarly, font
matching behavior of localized names is tricky on OSX, proper OS API's
for dealing with this are only available on 10.6.

The last constraint (e) I don't quite understand.  Typically platforms
don't share font families beyond the basic web fonts.  Are you saying
you want large font families like Minion Pro to work with the same
name on Windows and OSX?

A larger question is are you targeting CSS 2.1?  Or CSS3 Fonts?  CSS
2.1 doesn't have tight conformance family naming constraints.  CSS3
Fonts conformance will be tighter but there are still problems rooted
in OpenType spec problems that we can't completely fix.  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.

> Arial Black comes with XP and Vista as well [source:
>]. Office 2007 adds Arial
> Narrow (4 faces), which, like Arial Black and the standard 4 faces
> of Arial, use the same preferred family name, "Arial".

Sure, but ask what faces belong to the 'Arial' family and you'll get
different answers from GDI (basic 4 faces) and DirectWrite (basic 4
faces plus black face).

A similar disparity exists on OSX, if you use Carbon interfaces as
Flash has for a long time you get different answers for what faces
belong to which family compared to Cocoa APIs.  What users see in
FontBook will match the Cocoa API and will be closer to what
DirectWrite APIs report.  I would strongly suggest you base your
project(s) on these APIs, with some level of fallback code for dealing
with our dear friend Windows XP.


John Daggett

Received on Wednesday, 23 June 2010 10:25:11 UTC