RE: Why doesn't 'font-weight: 100' work yet?

Look to the operating system if you are on Windows. There are some
things that don't work as you would expect. If you set the font name for
the specific font name instead of font-family and weight you will work
better. Until Windows GDI is changed this is pretty hard to solve.



-----Original Message-----
From: [] On
Behalf Of Bert Bos
Sent: Wednesday, August 22, 2007 9:17 AM
Subject: Why doesn't 'font-weight: 100' work yet?

It used to be that the font APIs on many operating systems weren't rich
enough to put more than two weights in one family. That's no longer the
case, but most browsers still don't seem to recognize any weights other
than 'normal' or 'bold'. Why is that?

E.g., the fontconfig library on my system finds all three weights of
Gill Sans, but my browser doesn't:

    $ fc-match "Gill Sans:weight=thin:slant=roman"        # 100
    GillSansLight.ttf: "Gill Sans" "Light"
    $ fc-match "Gill Sans:weight=extralight:slant=roman"  # 200
    GillSansLight.ttf: "Gill Sans" "Light"
    $ fc-match "Gill Sans:weight=light:slant=roman"       # 300
    GillSansLight.ttf: "Gill Sans" "Light"
    $ fc-match "Gill Sans:weight=book:slant=roman"        # 400/500
    GillSans.ttf: "Gill Sans" "Regular"
    $ fc-match "Gill Sans:weight=normal:slant=roman"      # 500
    GillSans.ttf: "Gill Sans" "Regular"
    $ fc-match "Gill Sans:weight=demibold:slant=roman"    # 600
    GillSansBold.ttf: "Gill Sans" "Bold"
    $ fc-match "Gill Sans:weight=bold:slant=roman"        # 700
    GillSansBold.ttf: "Gill Sans" "Bold"
    $ fc-match "Gill Sans:weight=extrabold:slant=roman"   # 800
    GillSansBold.ttf: "Gill Sans" "Bold"
    $ fc-match "Gill Sans:weight=black:slant=roman"       # 900
    GillSansBold.ttf: "Gill Sans" "Bold"

(Fontconfig uses slant instead of font-style and instead of
100...900. We could discuss whether "book" maps to 400 or to 500, but
for the rest the mapping is straightforward.)

  Bert Bos                                ( W 3 C )                               W3C/ERCIM                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France

Received on Wednesday, 22 August 2007 22:27:40 UTC